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

Occlusion issue with changes to log depth equation #8725

Closed
TJKoury opened this issue Apr 4, 2020 · 4 comments · Fixed by #8727
Closed

Occlusion issue with changes to log depth equation #8725

TJKoury opened this issue Apr 4, 2020 · 4 comments · Fixed by #8727

Comments

@TJKoury
Copy link
Contributor

TJKoury commented Apr 4, 2020

Issue:

When adding primitives that are far (at least 11000000 m in one axis) away from ellipsoid center, occlusion is broken.

This commit seems to have changed the behavior.

Sandcastle example:
Example

Browser: FF, Chrome

Operating System: Linux

@lilleyse
Copy link
Contributor

lilleyse commented Apr 4, 2020

It seems like the bug only happens when the scene is rendering two frustums. @kring any ideas?

@kring
Copy link
Member

kring commented Apr 6, 2020

So the immediate problem is that, in the far frustum, the globe, depth plane, and centers of the points are rendered with a range (czm_currentFrustum value in the shader) of: [90000000, 99999998430674944]. But the point outlines are rendered with a range of [100000000, 99999998430674944]. Wat?! Investigating...

@kring
Copy link
Member

kring commented Apr 6, 2020

Hmm ok so it's the opaque frustum near offset. For log depth, it adjusts the near plane by 10%, or in this example 10 million meters! So basically the depth values are just rubbish. When log depth is off, we only adjust the near plane by 0.01% instead of 10%, and if I change the code to do the same for log depth this bug goes away. @lilleyse (or anyone else) do you have any idea why we need such a huge near offset with log depth? Here's the line I'm referring to:

return this._frameState.useLogDepth ? 0.9 : 0.9999;

@lilleyse
Copy link
Contributor

lilleyse commented Apr 6, 2020

@kring not sure, this was the last conversation on github about it #5851 (comment). I kinda took that change for granted.

If 0.9999 works we should probably just switch.

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 a pull request may close this issue.

3 participants