CesiumGS / CesiumGS/cesium

Depth plane causing clipping artifact

Open
#7,879 11 comments 0 reactions 0 assignees View on GitHub
category - graphics type - bug
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

I've run into this with various 3D Tilesets, but this is a good minimal example produced by Adam Twite in [this forum thread](https://groups.google.com/d/msg/cesium-dev/25wlWeLRPII/6x112pjpAwAJ):

[Sandcastle](https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=ZZFRT9swEMe/ipWXplJwWlKGgFANFSQeoEwDbS+RJje+phaOHd25QWXiu+/SBEa3KA93f9/v/L9zq1C0Bl4AxaVw8CIWQGZbyx97LR6V+3ThXVDGAY4S8btwgr8AiCx9Q98aDXj+DpYIKsBPj1Y/9SXxuHBv44vC9fdIKsGBrKxfgdTQhM0TULiquJLCgLCXtbIEDDHGFoGVAQcXTDBAUmkd7800nljxTnyYWCgMHCmXyTX6+hoqBKD4aDo9ldPZSXY6SUR2LL/MsuOzmUjEUTYZJ12r2muw3GcYcouGk5GU6cd/1TSUPqq6sXCtgkr3BKX9xffKDdEvDnnG1SjpO23AVJvwHdaA4Er4a/X28EAuH5Y3A0OlsnAuTiZd+na4xICqfAZ90y1jx8uBiyiJcgo7C/Oe/mrqxmPgGWzMvgOwZX4ZSldbJoMsibp+efoO5dq0wujLIvrn0YtIlFYR8cl6a+2jeYUimucp1x9g1ittXPXQAlq160o20/ldL0op85TT/6ngvV0p/NTxDw). Just try tilting the camera up a bit.

![depth_plane_czm_man](https://user-images.githubusercontent.com/1711126/58595504-e13d8780-823e-11e9-9c7c-00f2f7f5adf0.gif)

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

Contributor guide

Open the contributing guide

Research direction

Start with the Sandcastle example in the issue and reproduce the clipping by tilting the camera upward. Then inspect Source/Scene/Scene.js around line 2307, where depthPlane.execute is called, and compare the result with that call disabled. Done means the underground 3D model remains visible without the depth-plane clipping artifact while preserving the intended globe depth behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.