Hi,
I create my primitives the following way:
When my zoom level is close to the surface, it seems to test the depth of the polyline and use the depthFail appearance (-100m Boston):
However, if I zoom my camera out, the polylines become solid.
Why is it happening? Is there some parameter that is responsible for using depth test or not?
Hi @ddaddadda, do you want to make the polyline always visible? If so, you can simply turn off the depth test in the polyline appearance.
const appearance = new Cesium.PolylineColorAppearance({
translucent: false,
renderState: {
depthTest: {
enabled: false, // shut off depth test
},
},
});
Here is a modified Sandcastle demonstrating this approach.
If you want the part of the polygon below the surface to be properly occluded based on the depth value at different points, it will be more difficult. When zoomed out, -100m is small relative to the depths in the scene, so the depth buffer may not have enough precision for an accurate depth test. One option would be to split the polyline into above- and below-ground segments by pre-computing the points where the line intersects the surface.