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 plane causing clipping artifact #7879

Open
OmarShehata opened this issue May 29, 2019 · 11 comments
Open

Depth plane causing clipping artifact #7879

OmarShehata opened this issue May 29, 2019 · 11 comments

Comments

@OmarShehata
Copy link
Contributor

I've run into this with various 3D Tilesets, but this is a good minimal example produced by Adam Twite in this forum thread:

Sandcastle. Just try tilting the camera up a bit.

depth_plane_czm_man

Here, the 3D model is actually underneath terrain, but depth testing is turned off, so it should show through. It clips because the depth plane (which is used to write depth on the ellipsoid when the globe tiles don't, so that things on the opposite side of the globe don't show through). You can verify this by commenting out the depthPlane.execute line here in Scene.js:

https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/Scene.js#L2307

@lilleyse
Copy link
Contributor

A simple short-term fix would be to move the depth plane execution after the 3D Tiles pass. The drawback to this is 3D Tiles may show through the globe when depthTestAgainstTerrain=false, but this would only happen for tilesets with a huge geometric error. It wouldn't fix that Sandcastle either. It's probably a worthwhile tradeoff to make.

The better fix is to compute the depth plane differently. I don't know what that would look like yet.

@lilleyse
Copy link
Contributor

#7859 looks like the same issue

@pjcozzi
Copy link
Contributor

pjcozzi commented May 30, 2019

That short-term fix sounds reasonable enough.

The other option is to replace the depth plane with a depth cone - so instead of having a plane, use a cone with the vertex on the other side of the globe so it is like an ice cream cone with the ice cream being the front half of the globe facing the user and the cone inscribed in the back half of globe.

If this can be done fast, maybe just do this right away instead of the short-term fix.

@lilleyse
Copy link
Contributor

#8398 had a workaround that pushed the depth plane ellipsoid inward based on the the Mariana Trench's depth. A better approach will involving finding the min/max heights based on the loaded terrain tiles / 3D Tiles kind of like #8398. Or try out the depth cone.

@TJPovey
Copy link

TJPovey commented Dec 14, 2020

Hi, is this being actively worked on? Is there any reason #9200 hasn't been merged? This is causing us quite a few issues for clients with assets located in the middle east region.
Thanks,
Tom

@grantis
Copy link

grantis commented Jan 28, 2021

Hi, also curious if this clipping issue being worked on. I'v posted a similar issue on the Cesium forum https://community.cesium.com/t/czml-data-source-gtlf-model-disappears-a-certain-camera-angles/11214/5

@mDeligalabov
Copy link

mDeligalabov commented Aug 23, 2023

Hi, is there a fix for this bug? I have checked all around the net on this but still nothing that works.

@lilleyse
Copy link
Contributor

@mDeligalabov You should be able to use the depthPlaneEllipsoidOffset option added in #9200

@mDeligalabov
Copy link

Thank you @lilleyse this information leaded me to more information. One thing that I still find strange is that with camera movements the ellipsoid value is also moving up and down. Shouldn't this be considered as a bug since the for example the Cartographic instance height is relying on this?

@ggetz
Copy link
Contributor

ggetz commented Dec 4, 2023

Also reported in #11658.

@zachsussman
Copy link

depthPlaneEllipsoidOffset doesn't appear to work correctly with clustering. With clustering on, the clipping still happens, while with clustering off, depthPlaneEllipsoidOffset fixes the issue.

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.

8 participants