Polygons colors are blending randomly

I have 2 polygons drawn over the same points, where one of them is red and the other is green.

However, sometimes (randomly as far as I can tell) their colors just blend together, even though they both have their alpha set to 1.0 and translucent to false. Other times they seem to be just fine.

Here is a fiddle with a demo of the problem, which as I said, sometimes work and sometimes it doesn't.

Am I missing something?


You’re not missing anything. This is a known issue in Cesium and in graphics terms is known as z-fighting. Essentially you have two opaque objects that are covering the same exact spot in 3D space. Properly layering in cases like this is not something Cesium currently handles (but will eventually). This isn’t my area of expertise so Patrick/Dan/Kevin might be able to chime in with some additional details.