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

Depth Test Failure / Z-fighting #12337

Closed
TJKoury opened this issue Nov 25, 2024 · 6 comments · Fixed by #12385
Closed

Depth Test Failure / Z-fighting #12337

TJKoury opened this issue Nov 25, 2024 · 6 comments · Fixed by #12385

Comments

@TJKoury
Copy link
Contributor

TJKoury commented Nov 25, 2024

What happened?

In 1.123, intermittent depth test failure or z-fighting issue. Not present in <1.122, unsure if it was introduced in 1.122 or 1.123. Goes away if viewer.scene.globe.depthTestAgainstTerrain is set to true.

image

Reproduction steps

Open sandcastle, track GeoEye-1, see the primitives show through the globe.

Sandcastle example

https://sandcastle.cesium.com/?src=CZML.html&label=DataSources

Environment

Browser: Version 131.0.6778.85 (Official Build) (64-bit)
CesiumJS Version: 1.123.1
Operating System: Pop!_OS 22.04 LTS

@jjhembd
Copy link
Contributor

jjhembd commented Dec 4, 2024

@TJKoury thanks for the report!
I wasn't able to reproduce the bug on Windows.
image

Could this be OS-specific? Something about depth textures not supported, or lower depth buffer precision?

@TJKoury
Copy link
Contributor Author

TJKoury commented Dec 4, 2024

Maybe, however here it is on mobile using an iPhone 14 Pro Max. I have not tried it on Windows. Track one of the satellites and see if that makes a difference.

It definitely did not do this prior to 1.122, some of the recent shader / pipeline work would be my guess.

@jjhembd
Copy link
Contributor

jjhembd commented Dec 9, 2024

Thanks @TJKoury,
When I track GeoEye1, I can sort of reproduce: I get brief flashes (maybe 1 frame) of the other side showing through. It only happens near certain time stamps.
Just wanted to let you know I'm working on it. I'll still need to refine my test case a bit, before I can properly trace back where it broke.

@jjspace
Copy link
Contributor

jjspace commented Dec 11, 2024

@jjhembd this was also reported in #12371, might be another good sample sandcastle to help track this down.

@Rubeanster
Copy link

Yeah I see the same issue since I upgraded from 1.114 to 1.124. Seems like while tracking an entity I get flickering from other polylines. I couldn't get it to happen while not tracking an entity but working with the camera is a bit harder in that case to orientate it so not certain on that one.

@jjhembd
Copy link
Contributor

jjhembd commented Dec 20, 2024

I traced the bug to a single line from #12188. We changed this:

    positionEC = czm_modelView * position;
    gl_Position = czm_projection * positionEC;

to this:

    positionEC = czm_modelView * position;
    gl_Position = czm_modelViewProjection * position;

Reverting this change fixes the bug on my machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants