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

Make primitives/entities not cull when below ellipsoid but above terrain #8398

Merged
merged 3 commits into from
Dec 10, 2019

Conversation

IanLilleyT
Copy link
Contributor

@IanLilleyT IanLilleyT commented Nov 15, 2019

The current system culls entities/primitives when they are below the minimum radius of the earth, ~6356752 meters. In practice there are not many points on earth that are below this, except maybe https://en.wikipedia.org/wiki/Bentley_Subglacial_Trench which cesium world terrain doesn't accurately map. But with terrain exaggeration enabled or some other configuration, this becomes a problem. The proposed fix is to keep track of the minimum rendered terrain tile height and offset the scene's occluder radius by it. This information could also assist in choosing a better distance for the depth plane: #8203.

In this Sandcastle, left click to spawn red dots. In master, the dots do not appear. In this PR, they do.

This is a draft PR because there are a few unknowns:

  • Do we want to include 3D tiles when calculating this minimum distance?
  • Instead of limiting the offset to 0, what if it could offset upwards when all terrain heights are above 0. Any hidden downsides to this?
  • What should happen to entities if the globe is missing tiles?

@cesium-concierge
Copy link

Thanks for the pull request @IanLilleyT!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@lilleyse
Copy link
Contributor

lilleyse commented Dec 10, 2019

This could be less conservative by setting the occluder radius to the min distance rather than the minor axis minus the min height. You could have a case where an entity at the equator is 11000 meters below the ellipsoid, in which case it would create a smaller occluder than needed since the entity itself would not be below the minor axis.

In the end though we're talking about ~11000 meter difference in an already very conservative occluder (the occluder radius is the minor axis which is approx. 20000 meters smaller than the semi-major axis). If we were truly concerned about perfect occlusion tests we would use an ellipsoid vs. sphere test, though I think the math gets fuzzier and slower.

@lilleyse lilleyse merged commit 7dd9bbb into master Dec 10, 2019
@lilleyse lilleyse deleted the underEllipsoidCullingFix_Primitives branch December 10, 2019 23:18
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.

3 participants