I was hoping to use depthFailMaterial when displaying some polygon data, it works well for polylines but it seems not to be an option for polygons – is there a technical reason why that can’t work for polys too (and actually, all Entity types with a shading material)?
Or is there perhaps another way of disabling the depth test for specific entities?
Looking at the original feature addition (https://github.com/CesiumGS/cesium/pull/5160) it looks like adding a depth fail material for other types of entities was considered, but put on the backburner until more use cases came up.
…and that gives me the right result for my polygons, but I’m hoping for a way of doing that for some polygons that rest against other surfaces to enable them to be visible, rather than for all primitives in the scene.
This will be a very common issue for anyone drawing polygons on to photogrammetry (e.g. drone) 3DTile data, as there is always some noise and so the polygons will be badly rendered, intersecting the surface rather than on top.
Thanks – that’s an interesting workaround if the case was limited to drawing polys on to to the ground, but in my case they need to be arbitrary, e.g. drawing on to the side of a building or steep slope, so classifying via vertical projection won’t work. Even if you could set a projection vector it wouldn’t work in all cases, e.g. a polygon on a convave curved surface, e.g. a sloping ground which gets steeper to become a vertical cliff, very common for coastal datasets
In any case, that feels like a very different kind of functionality, what I really want is a normal polygon Entity, but stop depth testing (or preferably, set a depthFailMaterial). Having control over depth testing has already been established as a very useful thing for billboards and polylines, and I think it is equally useful for polygons, and would then also ensure more consistency between geometry types.
In the meantime though, you hinted that it should be possible to access the underlying polygon primitive and set its depthFailAppearance? Is it possible to do that when the polygon is created as an Entity, or I would need to create them from the start as the lower-level Primitive type?
You are correct - this is indeed a problem we have an open issue for (https://github.com/CesiumGS/cesium/issues/7453). The goal is for this to be an easier way to color/highlight arbitrary surfaces in 3D Tiles, so I was curious if you’d already considered it or run into other issues.
I think the reason why this isn’t already exposed is that polygons that are clamped to ground use the GroundPrimitive, instead of Primitive. GroundPrimitive does not have a “depthFailAppearance” option yet. I have a GitHub issue here to consider supporting for clamped lines: https://github.com/CesiumGS/cesium/issues/8635