Lags while camera movement (gfx.waitforpresent)
Hello we are really frustrated, because we can not figure out what kind of issue is causing our Problems with the Unity camera movement.
First our project setup which we use:
Unity version: 5.5.0f3
CPU: i7 4930k
GPU: NVIDIA GeForce GTX TITAN
RAM: 32 GB
Monitor 1: Samsung 24 Zoll at 1080 x 1920 60Hz
The following monitors are used in Portrait mode:
Monitor 2: Samsung 55 Zoll at 2160 x 3840 60Hz
Monitor 3: Loewe 55 Zoll at 2160 x 3840 60Hz
The project itself is an easy application. We only have simple graphic entities in our scene (see screenshot) and we have a camera which is animated from the left to the right side. The application will run on one of the 4K screens mentioned above.
Now the frustrating Problem:
When we enter the play mode in the UnityEditor the whole scene is lagging/stuttering as hell, even though we have (with vsync disabled) real high frame rates (above 200fps). We just checked if it is maybe the monitor, so we just switched from Loewe back to the Samung 4K tv but that also did not change anything. We even tried the scene on the normal 1080p Monitor and the lag is still there. Although on a more powerful Workstation ( 2x Titan X pascal) the camera movement is laggy. We also tried to use the profiler to check what is causing this lag. There we discovered two different kind of spikes in the profiler. The first one is called Gfx.WaitForPresent and the second one is called WaitForTargetFPS. Until now we couldn't figure out how we can solve this problem.
Other things we tried:
-update graphics driver
- use other Monitor
- Setup occlusion culling for whole scene
- animate camera directly via script not with UnityAnimationSystem
- used stronger machine
- checked windows resource manager while in play mode (CPU an Ram are bored)
- We also checked the refresh rates of the monitor (all set to 60 Hz)
- also tried other animations (different directions, rotations, etc.)
Maybe we missed something and someone of you got an idea what we could try, to get rid of this lag.
Some screenshots to get an idea what our scene looks like: First screen is our scene setup Second screen is the Gfx.WaitForPresent and WaitForTargetFPS
Your answer
Follow this Question
Related Questions
Unity Game Preview Lagging With DirectX 11 4 Answers
Bad Performance URP 0 Answers