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

Extend far plane slightly to prevent clipping #9139

Merged
merged 2 commits into from
Sep 5, 2020

Conversation

lilleyse
Copy link
Contributor

@lilleyse lilleyse commented Sep 5, 2020

Fixes #9114

#8850 made it so that the far plane only goes as far as the farthest object visible to the camera. The problem was geometry right on the far plane might get clipped at certain camera angles. This was somewhat hardware dependent since the problem didn't happen on my 2015 Macbook but happened on mostly everything else.

The fix was to extend the far plane a bit further than the farthest object:

// Extend the far plane slightly further to prevent geometry clipping against the far plane.
far *= 1.0 + CesiumMath.EPSILON2;

Here's a debug view showing the problem. The ground primitive's bounding volume lines up almost perfectly with the frustum which causes clipping.

alignment2

alignment

Sandcastle for testing

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ Signed CLA found.
  • ❔ 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 lilleyse force-pushed the fix-classification-artifact branch 3 times, most recently from cce4c72 to b062edf Compare September 5, 2020 16:07
@IanLilleyT IanLilleyT merged commit 2202fd0 into master Sep 5, 2020
@IanLilleyT IanLilleyT deleted the fix-classification-artifact branch September 5, 2020 23:34
@IanLilleyT
Copy link
Contributor

Looks good to me, the fix makes sense and it fixes the problem, Thanks @lilleyse

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.

Ellipse on ground has hole in it when camera is perfectly perpendicular to ground
3 participants