Rendering artifacts on large polygons over the horizon

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

Large polygons with heights have some rendering artifacts as their vertices go over the horizon. This does not occur when using GroundPrimitive to clamp the polygon.

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

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

Just need the polygon to show correctly as the camera is rotated.

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

Cesium 1.59, Chrome 75.0.3770.142, OS X 10.14.5

I did a bit of looking through the issues archive to see if this was written up already, but nothing jumped out at me as being a duplicate.

That may have been the wrong sandcastle link. Here’s the correct one:

I think the problem here is that the polygon is partially under ground, which you can see by setting depth test to true:

viewer.scene.globe.depthTestAgainstTerrain = true;