Cesium surface transparency

My need is to specify a range within which the ground can reduce transparency and see underground pipes. I know that cesium has a clipplane, but this is not what I want. Is there any way to achieve the effect I want, please let me know, thank you!

Effects like this


I think this might require writing a custom shader. The clipping plane code might be relevant here in that it discards pixel underneath the plane. Instead of discarding, you could modify the alpha instead. This blog post might be a good start on custom shaders:


This is where the shader for the clipping plane exists:


It might be easier to modify the source of the clipping plane shader as a start, since setting up your own shader and integrating it with CesiumJS’s rendering right now is non trivial.

If you do get something working here I’d love to see! This is definitely something I’d love to see made easier through the CesiumJS API. There’s an issue with a similar feature request here: