-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Entity incorrectly occluded when no tile is in view #10932
Comments
Thanks for the report @calogeromauceri! I believe you are correct in explaining why this is happening. This may be tricky to fix without a performance hit since, for a true fix, I think we'd need to iterate through additional tiles each update. @kring would you happen to have additional insight here? |
When there are no tiles, then perhaps the |
I'm happy to help fixing this problem as long as I have some guideline on how to do it. @kring I think the solution you are proposing is a good one, but how do we know the minimum terrain height? should it be a setting parameter for the globe or is it possible to get it somehow querying the terrain provider? |
Any updates on this issue? I'm happy to help if needed! |
Thanks @calogeromauceri.
Other than that, I don't believe it's trivial to get the minimum terrain height at runtime. Perhaps we could allow the user to specify these values themselves. |
Thank you very much for your suggestion, @ggetz. Based on your hint, I’ve come up with a fix. I'll submit a pull request with my changes soon. Note: I updated the sandcastle example to show the issue with latest Cesium version (currently 1.121) |
I closed the pull request because, as discussed in the pull request conversation, the fix does not solve the issue in all scenarios. Specifically, it works when not tiles are in view, but when the camera is looking at the horizon with a few tiles visible, if their minimum terrain height is higher than the camera height, the entities remain occluded. Currently, I do not have other ideas on how to fix this problem. The occlusion detection is disabled when the camera is under the terrain or when the globe is translucent, but neither applies to this case. I'd appreciate any suggestions for another solution |
When the camera is below the ellipsoid minimumHeight and looking at an entity with no tiles in view, then the entity gets incorrectly occluded
Here is an example using moon terrain, where the camera is located in a region that goes below the mean radius.
When the camera is above the mean ellipsoid radius the sphere on the sky (it might be a planet) and the sun are properly rendered. When the camera is below the mean ellipsoid radius the sphere and the sun are not rendered
Sandcastle example
The problem is in the occluder being used for checking if the entity is visible or not.
https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Scene/Scene.js#L1799-L1823
If no tile is in the current view the scene frame minimumTerrainHeight is set to 0, so the occluder bounding sphere radius is equal to the ellipsoid minimum radius which in this case is above the camera location, causing the camera to be "occluded".
When tiles are visible (in the sandcastle above select "horizon"), then the scene frame minimumTerrainHeight is properly computed.
Browser:
Any
Operating System:
Any
The text was updated successfully, but these errors were encountered: