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

![0}5C6ETEE6TF54XX3]0@W3.png|400x267

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:

https://cesium.com/blog/2019/04/29/gpu-powered-wind/

This is where the shader for the clipping plane exists:

https://github.com/AnalyticalGraphicsInc/cesium/blob/79a49e09a89141653bcd557ba5f9804aaa1caaa7/Source/Scene/getClippingFunction.js#L76-L107

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:

https://github.com/AnalyticalGraphicsInc/cesium/issues/7652