Open mramato opened 4 years ago
This is not just an issue with ground polygons, I'm seeing this in 3D with points (and polylines).
The problem is depth test is being permanently turned off for the primitive after creating it in 2D. Depth test should be turned back on when going back to 3D, but it's not.
Left is when creating the polyline in 2D, Right is when creating it in 3D first:
Looking deeper, the OIT derived translucent command creates its render state from the derived log depth command, and so if the polyline was created in 2D mode, it forever inherits the depth test off property. https://github.com/CesiumGS/cesium/blob/d07271e21e6f407b6159f44068113a231499d11a/Source/Scene/OIT.js#L563-L566 and https://github.com/CesiumGS/cesium/blob/d07271e21e6f407b6159f44068113a231499d11a/Source/Scene/OIT.js#L584 are the culprits.
In subsequent renders, it copies the log depth command render state in the first code block but reverts it back to its original state in the second.
Not sure where to go from here though as I'm not very familiar with these systems.