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 flickering for tileset with thin walls #5940

Merged
merged 4 commits into from
Oct 30, 2017
Merged

Fix flickering for tileset with thin walls #5940

merged 4 commits into from
Oct 30, 2017

Conversation

lilleyse
Copy link
Contributor

This builds on #5820 which is the right idea but for me didn't completely solve the flickering, especially on the roof of the AGI building.

Originally I thought the flickering was caused by children rendering with their parents, but the problem is actually rendering the back faces and front faces of the same tile simultaneously, as required by the skip-lods approach. Normally this is never a problem, but it is a huge problem for thin walls where back and front faces overlap. Fixing the depth test in #5820 to allow the front face to render above the back face when it's depth is equal seems like it should work, but I think the test is too precise. Apply a polygon offset to the back faces seems to work better. Essentially it pushes the back face depth to "solidify" the geometry.

At some point @austinEng and I talked about disabling color-writes for the back face commands, and I think that was kept in because of this flickering bug, the rationale being it's better to show the back face color during the flicker rather than see through the model. Because the flickering is mostly gone now I disable color writes for back faces, hopefully we get some performance win there.

The last thing in this PR is not rendering back faces for leaf tiles. I think there could be an edge case here where a tile further in the distance with a greater selection depth could appear in front of the tile up close, but I think this situation is rare and haven't noticed it happen yet during my testing.

Before and after:

flicker-badd
flicker-good

@cesium-concierge
Copy link

@lilleyse, thanks for the pull request! Maintainers, we have a signed CLA from @lilleyse, 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! Thanks again.

@bagnell
Copy link
Contributor

bagnell commented Oct 26, 2017

This looks good to me, but you have to update the failing back face test.

@lilleyse
Copy link
Contributor Author

Just pushed the commit right as you commented.

@lilleyse
Copy link
Contributor Author

Bump - so this gets into the release.

@bagnell bagnell merged commit 5731e2f into master Oct 30, 2017
@bagnell bagnell deleted the fix-flickering branch October 30, 2017 21:59
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