-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Fix log depth z fighting #6513
Fix log depth z fighting #6513
Conversation
@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@lilleyse can you please review this ASAP Monday morning, I don't want to merge any last minute PRs on Tuesday. |
@@ -7,6 +7,13 @@ void czm_updatePositionDepth() { | |||
#if defined(LOG_DEPTH) && !defined(DISABLE_GL_POSITION_LOG_DEPTH) | |||
v_logPositionEC = (czm_inverseProjection * gl_Position).xyz; | |||
|
|||
#ifdef ENABLE_GL_POSITION_LOG_DEPTH_AT_HEIGHT | |||
if (length(v_logPositionEC) < 2.0e6) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix works... I'm just wondering if there is anything special about 2.0e6
or if it just happens to be a good value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I zoomed in to the edge of the polygon and slowly zoomed out until I saw the z fighting. Tested with larger and smaller polygons than what was in the bug example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks!
Fixes #6508.
This was caused by #6465. This enables writing log depth to gl_Position when the camera is far enough away.