Skip to content

Fix camera rotation uncontrollable with low framerate#5076

Merged
sebastienlagarde merged 4 commits into
hd/bugfixfrom
hd/fix/camera-controller-template
Jul 20, 2021
Merged

Fix camera rotation uncontrollable with low framerate#5076
sebastienlagarde merged 4 commits into
hd/bugfixfrom
hd/fix/camera-controller-template

Conversation

@alelievr

@alelievr alelievr commented Jul 6, 2021

Copy link
Copy Markdown
Contributor

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

@alelievr alelievr self-assigned this Jul 6, 2021
@alelievr alelievr requested a review from a team July 7, 2021 17:16
@alelievr alelievr marked this pull request as ready for review July 7, 2021 17:16

@JulienIgnace-Unity JulienIgnace-Unity left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@alelievr

alelievr commented Jul 8, 2021

Copy link
Copy Markdown
Contributor Author

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 TomasKiniulis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions

Copy link
Copy Markdown

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.
Link to Yamato: https://yamato.cds.internal.unity3d.com/jobs/902-Graphics
Search for your PR branch using the sidebar on the left, then add the following segment(s) to the end of the URL (you may need multiple tabs depending on how many packages you change)

HDRP
/.yamato%252Fall-hdrp.yml%2523PR_HDRP_2021.2

SRP Core
You could run ABV on your branch before merging your PR, but it will start A LOT of jobs. Please be responsible about it and run it only when you feel the PR is ready:
/.yamato%252F_abv.yml%2523all_project_ci_2021.2
Be aware that any modifications to the Core package impacts everyone in the Graphics repo so please discuss the PR with your lead.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants