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

fixes issue #12356 performance drop due to EnvironmentMap #12358

Merged
merged 13 commits into from
Jan 2, 2025

Conversation

jfayot
Copy link
Contributor

@jfayot jfayot commented Dec 4, 2024

Description

This is a proposal to fix / workaround performance drop due to EnvironmentMap.

Issue number and link

Fixes #12356

Testing plan

  • Updated Cesium3DTilesetVisualizerSpec and ModelVizualizerSpec
  • Run following Sandcastle.

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 updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

github-actions bot commented Dec 4, 2024

Thank you for the pull request, @jfayot!

✅ We can confirm we have a CLA on file for you.

@jfayot jfayot changed the title fixes issue #12356 performance drop fixes issue #12356 performance drop due to EnvironmentMap Dec 4, 2024
@ggetz
Copy link
Contributor

ggetz commented Dec 6, 2024

Thanks for the PR @jfayot! Instead of a specific enableEnvironmentMap property, what do you think of allowing the constructor options, similar to what we do for Model.js?

Also, given that entities' positions are usually more dynamic than static models or tilesets, I'm thinking for entities specifically, we make the threshold for updating environment maps much higher or disable them entirely. That way, the environment map generation only runs once on load.

@jfayot
Copy link
Contributor Author

jfayot commented Dec 7, 2024

Thanks for the review, @ggetz !

what do you think of allowing the constructor options, similar to what we do for Model.js?

As far as you consider DynamicEnvironmentMapManager as a high-level interface, yes, this can be added to Entity's constructor options. I didn't go that way because, in my understanding, it was rather a low-level interface associated with primitives.

for entities specifically, we make the threshold for updating environment maps much higher

I think that finding a threshold that fits for all use cases will be difficult ! It's probably better to disable the environment map by default for entities and let the user decide the appropriate options.

@jfayot
Copy link
Contributor Author

jfayot commented Dec 9, 2024

@ggetz I've added environmentMapOptions to Entity constructor. Tell me if this is what you had in mind...

@jfayot
Copy link
Contributor Author

jfayot commented Dec 20, 2024

Hi @ggetz , I hope you're doing well !
Do you think there's a chance to get this PR in 1.125 ?
I haven't seen much activity on the repo since 2 weeks. Should I get worried 😬 ...

@ggetz
Copy link
Contributor

ggetz commented Jan 2, 2025

Hi @jfayot! Apologies on the delayed responses– Many have been out for the holidays.

Work done in #12370 appears to address the performance issue demonstrated in #12356. Can you confirm?

However, the additional failsafe in this PR is also beneficial IMO. We'll take a pass on this and hopefully get it into today's release. Thank you!

@jfayot
Copy link
Contributor Author

jfayot commented Jan 2, 2025

Hi @ggetz ! Happy new year to you and the Cesium team !

Yes I can confirm that your PR #12370 fixes the issue: back to 60fps when moving entities more than 1000m.

@ggetz
Copy link
Contributor

ggetz commented Jan 2, 2025

I think that finding a threshold that fits for all use cases will be difficult ! It's probably better to disable the environment map by default for entities and let the user decide the appropriate options.

I was thinking we don't entirely disable the environment map, but set the update timing to Infinity so that it's only generated once. If you agree, I can push the update to this branch.

@jfayot
Copy link
Contributor Author

jfayot commented Jan 2, 2025

I think that finding a threshold that fits for all use cases will be difficult ! It's probably better to disable the environment map by default for entities and let the user decide the appropriate options.

I was thinking we don't entirely disable the environment map, but set the update timing to Infinity so that it's only generated once. If you agree, I can push the update to this branch.

Sure, that's fine for me!

@ggetz
Copy link
Contributor

ggetz commented Jan 2, 2025

@jfayot If these updates work for you, I think this should be ready to go!

@jfayot
Copy link
Contributor Author

jfayot commented Jan 2, 2025

@jfayot If these updates work for you, I think this should be ready to go!

It works for me @ggetz ! Thanks for the update.

@ggetz ggetz merged commit db4cfe5 into CesiumGS:main Jan 2, 2025
4 checks passed
@ggetz
Copy link
Contributor

ggetz commented Jan 2, 2025

Thank you @jfayot!

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.

Severe performance drop since 1.123
2 participants