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.

https://cesiumjs.org/Cesium/Build/Apps/Sandcastle/#c=tVTbTttAEP0VKy84UrrZ+wUCKlCkPlBR0YtU1X1YnE1s1VlH9iY0Rfx7x3HshFJ461qy7JlzZubszuzaVtE6d/euik4j7+6jS1fnqwX6urXFR+n297L0webeVUfDk8Qnfg2su2LlLspfQGv5yPmQh9zVyE6n8UMSuieKEh/B8nbhouMoGVwAMwJqMhi1nmVZbOalB+dDa2jWeJy5fJ6F4wiP9tYsd5Wt0mwD4F2pl7YK8GU9Q7OqXLxz88q5+ryq7Cb+/gYjwjCjXGqmlMDUMDWKBEGCEWGIlJpjPYpaGMXNi0jMOGcdShJgaWKENrwDcqGV4ZQKpXiH01pLhQVjWHUwKYghjCquuaR9WsME00YZuk/MBePUaAzhOCU7IFRDCadKSE5EhwQBkmOlGTOE7oUIjIWghJEWB7EUoKiUWED6HiilwBqqAXKvGdQSrAQUDxr71ALCcY0N571oRpgR3EDt0ugOCAVSDZtBOOuBwlCDuVQgX0vWIwWF8jE2vRbQyzUEVYpgzPapKdFKUWNexRGjBOSEjcA9EE4Tw6ZTDVsse9GGakUEHCPRP4ajw75s1765Fja4KrfFQW+VRVmh25tv59cX11+u0H0esvNimdkYIzFsmY/7kIl/bAcERqQdilmx+VzGu1kZNf1dzma1C5DiYNreOzvN/fxjHtLs1vq5i3eODzZkKJS34La+jvHwYBSern8T3hiMgEQxHj6nNNWikDkfz1Y+DXnp4+FuAF+svnH+JwWvqODiNRXbQ3hJyYGa2hUuDW561VxUm9PuBjvpIpxsj28wGkzqsCncWWt/my+WZRWiVVXECI2DWywL6JN6fLdKf7qA0rpumJNxR5pM83WUT0+TwV+XZzKI0sLWNXhmq6L4lP92yeBsMgb8E1pRbvfyZu2qwm4aSEbOrlsjQmgyht/nrFCWxZ2tDiL+AQ

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;

``