Fix camera rotation uncontrollable with low framerate#5076
Conversation
JulienIgnace-Unity
left a comment
There was a problem hiding this comment.
Do we really want to remove any deltaT component from the computation?
As it is here, I reckon the camera will feel very different depending on the framerate. Did you try to test with various frame rates to see how it behaves?
|
Yeah, I tried with different framerates, the issue is that the mouse movement we get is already a delta from last frame, so multiplying a delta with another screwed the result. Note that this is only true if the update loop actually slows down (CPU bound), and not if we lower the framerate manually with Application.targetFrameRate |
TomasKiniulis
left a comment
There was a problem hiding this comment.
Looks good to me. Comparing template between master and PR while stressing my CPU to force low framerate does feel like a subtle change for the better to camera responsiveness
|
Hi! This comment will help you figure out which jobs to run before merging your PR. The suggestions are dynamic based on what files you have changed. HDRP SRP Core Depending on the scope of your PR, you may need to run more jobs than what has been suggested. Please speak to your lead or a Graphics SDET (#devs-graphics-automation) if you are unsure. |
Purpose of this PR
Fix camera moving too much with low framerate in FreeCamera, SimpleCameraController and LookWithMouse.
https://fogbugz.unity3d.com/f/cases/resolve/1340344/
Testing status
Tested FreeCamera, SimpleCameraController and LookWithMouse with both new and old input system, movement in consistent with framerate:
60fps:
rotation-60fps.mov
5fps:
rotation-5fps.mov
https://yamato.cds.internal.unity3d.com/jobs/902-Graphics/tree/hd%252Ffix%252Fcamera-controller-template/.yamato%252Fall-hdrp.yml%2523PR_HDRP_trunk/7721737/job