Lines / polylines appear to clip when moving the camera despite not being under terrain

1. A concise explanation of the problem you’re experiencing.

In some camera angles, we see polylines clip as if they’re passing through terrain. However, the lines that are clipping aren’t low enough to be clipped by the terrain, so we’re not sure what’s causing the visual issue. The clipping changes as you move the camera.

2. A minimal code example. If you’ve found a bug, this helps us reproduce and repair it.

Here is a sandcastle example.

View the graphic from a bird’s eye view:

The above is what we expect to see for all camera angles: The lines are clipped only when they enter terrain ,and otherwise (like on the right side of the ellipse) are not clipped.

Next, zoom in a little and tilt the camera slightly downwards

Now we can see the lines that were previously unclipped on the right side are now being clipped by something. These lines are well above the terrain in that area (rotate the camera to a horizontal perspective to verify), but appear to be clipped regardless.

This “clipping” seems to change as you rotate the camera around the graphic. We’re looking for a way to avoid this clipping. Is this a known issue?

This issue only occurs when terrain is used. The lines have to be somewhat close to the terrain for this issue to occur, and it doesn’t seem to occur in Cesium 1.43.

3. Context. Why do you need to do this? We might know a better way to accomplish your goal.

We have some graphics in our application that show many lines clustered together like the above images. We’re currently using Cesium 1.43 and it looks fine, but when upgrading to Cesium 1.59, we see the above clipping behavior arise.

4. The Cesium version you’re using, your operating system and browser.

The issue can be seen in Cesium 1.50 through 1.59 on windows in chrome as far as I know. When we use Cesium 1.43 we do not experience the issue

Try setting:

viewer.scene.logarithmicDepthBuffer = false;

Does that fix it? If so, I think it may be related to this issue:

Thanks for the response, that fixed the issue. Definitely seems to be the same as the issue you linked (the gifs in that github issue look similar to what we were seeing).

Also, interestingly enough, the “logarithmicDepthBuffer = false” also seems to have solved another camera-related issue we were running into where the camera would randomly freeze during a zoom. For example, we would try to zoom in or out, and the camera would get stuck and be unable to zoom with right click or mouse wheel until we panned again. Once we panned, the issue would go away and we would be able to zoom again. Again, this issue was also somehow fixed by setting “logarithmicDepthBuffer=false”.

Not sure if the above is useful information to your team or not, but nevertheless thanks for the help!