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

Fix log depth z fighting #6513

Merged
merged 2 commits into from
Apr 30, 2018
Merged

Fix log depth z fighting #6513

merged 2 commits into from
Apr 30, 2018

Conversation

bagnell
Copy link
Contributor

@bagnell bagnell commented Apr 27, 2018

Fixes #6508.

This was caused by #6465. This enables writing log depth to gl_Position when the camera is far enough away.

@cesium-concierge
Copy link

Signed CLA is on file.

@bagnell, thanks for the pull request! Maintainers, we have a signed CLA from @bagnell, so you can review this at any time.

⚠️ I noticed that CHANGES.md has not been updated. If this change updates the public API in any way, fixes a bug, or makes any non-trivial update, please add a bullet point to CHANGES.md and comment on this pull request so we know it was updated. For more info, see the Pull Request Guidelines.


I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome.

🌍 🌎 🌏

@mramato
Copy link
Contributor

mramato commented Apr 30, 2018

@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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, thanks!

@lilleyse lilleyse merged commit 7a13df1 into master Apr 30, 2018
@lilleyse lilleyse deleted the z-fighting branch April 30, 2018 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants