Huge movement delay - unity3d

I am working with VR and found a big problem in step one. I followed the most basic tutorial and everything works fine until I try the app on my phone.
Even though the scene is extremely basic (just one plane, medium quality settings) there is a huge delay between the movement of the head and the app responding. I have a total amount of 2 Draw Calls, 2 Batches, 1.9k Tris. Frame rate on pc is 4000 Fps!. So it definitely is not an optimization issue.
I have unity updated to 2017.2.0f3 and GVR is version 1.100.1. My phone is a Huawei P8 Lite 2017.
Why is this happening?

I am not sure what tutorial you followed but it shouldn't have this issue. My suggestion is begin an empty new project, import GVR SDK and try to build the DEMO scene... check out if this works fast or slow.

Related

Lighting in Unity2D looking different on phone than in editor

I am working on a little mobile game in Unity in 2D. I want the player to be a light source and everything else to be dark, so I gave "everything else" the sprites/diffuse material. This works extremely well in the editor/Game view in Unity, but when I build to my Android phone it looks weird. See the pictures. Any ideas?
Currently I am using the realtime rendering mode for the light, I know it is not efficient, but that's a problem for later. I looked into baked lighting, but I spawn the rooms random and dynamically so I am not sure how to proceed there.
I can find very little information about lighting in 2D mobile games in Unity, not sure how to proceed, it is all very confusing.
How can I make the lighting look the same on the phone as in the editor/game view in Unity?
Sry for writing an answer instead of a comment, but I'm new to SO and don't have the rep to write comments, yet.
I had similar issues on my Android build and we would need way more information in order to help you.
(1) Are you building for Android, iOS or both?
(2) Check your graphics emulation. Make sure you use OpenGL3.
(3) Check your graphics tier upon build. Try to use the highest tier with high settings. Lower tier settings might result in bad light.
(4) Not necessarily corresponding to your issue but you might wanna try building with a 32-bit display buffer and see what happens.
(5) Are you using post processing effects? There is very limited support on mobile devices.
(6) Check the priority of each light source you are using.
(7) Maybe it's a shader issue? Have you tried using mobile shaders?
Hope this helps, again, sry for answer while not being 100% sure.
Cheers.

Performance spikes observed in unity profiler after adding the google-VR module

while a simple mobile unity game project (or a simple project with a cube and a camera) provides almost uniform CPU time with less variation while profiling it.
But adding the googleVR (tried latest and old versions) module to it, split into left and right eye (GVRviewer) and profile the VR mobile app provides a lot of spikes or variations which is due to VR.waitforGPU() and in turn gfx.processcommands(). can anyone please tell me what's the reason behind those performance spikes while adding GVR module ?
I have tried multiple optimizations (e.g. static batching, disabling vsync, optimizing mesh data) but nothing seems to be useful. Is there any possible way to get rid of this issue?

Unity Tango app crashing when using FindPlane function

Recently I've started porting my older Unity code with an earlier version of the Tango / Unity SDK to the latest version. Overall, it's working great. Faster frame rate, less drift, everything seems pretty good....Until: BLAM... Sudden crash. So, I tried paring down my app to the essentials to see if I could reproduce the crash and what I've found is that if I follow the AR Unity example in the docs to the letter, no problem. But, if I add a 'FindPlane' call within the Update() function so I place a sphere at the planeCenter of whatever is at 960,600 (middle of screen), after a few minutes the app will crash. So my suspicion is that this is what's causing the crash in my larger app (with many more moving parts, so to speak).
My question is two part:
1) can anyone suggest some debugging processes to help me identify exactly what the problem is here, in case it isn't the FindPlane function after all?
2) does anyone know why the FindPlane function might cause an error? Even if it doesn't successfully find a point it should still return Vector3.zero and a new/default Plane object, neither of which should result in a crash.
Thank you for your thoughts on this perplexing issue.
EDIT: I tried installing and activating Tango-Debug-Overlay recently and it shows a bit of diagnostic info. The problem appears to be thermal, and from what I can tell, related to the depth sensor. So now I'm trying to set a very low FPS, as a test, and disabling the depth sensor between frames, to see if that has any impact. I will post updates as I find out info.

Project-Tango | Unity Meshing crashes app

I downloaded the new Jih build of the Project-Tango Unity Samples.
Setting up my new project, I made sure to set the minimum API level to 17 in the Player Settings.
Howevery, when I try to start any of the two Meshing Demo scenes the App instantly crashes.
This is what I got from logcat, but I can't make any sense of it.
How do I fix this? Allowing out of date API did not help.
There's a bug with Unity on Tango. Try turn off the dynamic batching in player settings

How to make big game run more smoothly?

I am developing a ipad game using flash CS5. When I run it in flash or web browser, it run quite smoothly but when I published it into ipa file and run it on my own ipad, it became very very slow. Since my game has many stages and characters, the amount of symbols may up to more than 50. That makes the flash file more than 100mb (but the ipa is only 11mb) All of the symbols are exported in frame 1.
Therefore, I have some questions wish to understand:
1)if I used preloader and exports the symbols in frame 2, will my game run more smoothly? is one preloader when the game is loaded enough? or it is need for every game scenes?
2)Is there any other technique that a big game developed in Flash has to follow in order can be run in low configurations devices?
3)Why many other big game can run so smoothly although it contains a lot more characters and background than mine?
Thank you a lot for your help ^^
1) All the preloader will do is show your users that something is going on until the game starts. It will not affect game performance.
2) Yes: You have to optimize every calculation and every asset for small memory footprint and fast performance. Start here.
3) Because they spent a lot of time on 2)
On a side note: It is usually a good idea to have a main game loop, and do all the calculations in your game logic prior to a single rendering step, instead of having lots of independent timelines. In the rendering step, you can exclude and/or minimize all the efforts on objects that are out of sight, or not entirely visible.
A few things to keep in mind:
Upgrade to Flash CS5.5
Use flashplayer 11.0
Use AIR3.1 SDK
Publish using "GPU" (not CPU)
Object pooling!
Try using as much bitmaps as possible, vectors are "heavier".
'cacheAsBitmap' only on objects that move along the x / y axes
Alpha transparencies eat up your CPU
Did I mention Object pooling?
Attach a FPS monitor to your app, so you can keep track of frame-rate drops.
Do yourself a favour and ditch Flash. Write your game in Objective C / C / C++
Even Adobe and Microsoft are abandoning Flash for Mobile devices.
Btw, I'm no Flash hater - I've been a "Flash developer" since FutureSplash and still use the Flash IDE where appropriate, but not when targeting mobile devices.