Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not render constantly in requestRenderMode when dynamic geometries exist #11855

Merged
merged 9 commits into from
Mar 6, 2024

Conversation

rropp5
Copy link
Contributor

@rropp5 rropp5 commented Feb 23, 2024

Description

Avoid requesting a new render from the Scene every time a Primitive is ready. With dynamic Primitives, they are destroyed and re-created each frame so this means they must be marked "ready" each frame. If they request a render each time they are ready, there is an infinite rendering loop that breaks requestRenderMode.

These changes simple modify the setReady() function on Primitives so it only sets the ready state and does not request a new frame.

Issue number and link

This resolves the problems reported under #6631.

Testing plan

I created several sandcastles on the linked issue (#6631) to address Primitives and GroundPrimitives. I have also tested to confirm non-dynamic Primitives render as expected when requestRenderMode is enabled and when it is disabled.

Updated original Sandcastle from #6631 : Expected behavior is that the ellipse does not begin to move when play is pressed

Case 1: animation is paused, Infinity maximumRenderTimeChange

Ground Primitive : Expected behavior is that the ellipse only changes size when the "Request Render" button is clicked

Primitive : Expected behavior is that the ellipse only changes size when the "Request Render" button is clicked

Case 2: animation is active, 2 second maximumRenderTimeChange

Ground Primitive : Expected behavior is that the ellipse changes size every 2 seconds

Primitive : Expected behavior is that the ellipse changes size every 2 seconds

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have update the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Update Primitive _ready flag immediately instead of on the next render. This resolves the infinite rendering loop caused by dynamic Primitives which was reported under CesiumGS#6631.
Fix the broken unit tests
@rropp5 rropp5 changed the title Do not render constantly when dynamic geometries exist in requestRenderMode Do not render constantly in requestRenderMode when dynamic geometries exist Feb 24, 2024
@ggetz
Copy link
Contributor

ggetz commented Mar 5, 2024

Thanks for the suggestion @rropp5! I can confirm we have a CLA on file for you.

@ggetz
Copy link
Contributor

ggetz commented Mar 5, 2024

@rropp5 I think this is a valid way to address the issue. I've tested the example from #10517 where this code was originally added, and request render mode continue to function as expected.

Would you mind syncing up with main and updating CHANGES.md such that your fix is under the next release, 1.116?

@rropp5
Copy link
Contributor Author

rropp5 commented Mar 5, 2024

@ggetz No problem! The branches should be synced now and I added 1.116 to the CHANGES.md so I believe we're good to go.

@ggetz
Copy link
Contributor

ggetz commented Mar 6, 2024

Thanks @rropp5!

@ggetz ggetz merged commit 078ac4b into CesiumGS:main Mar 6, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants