When the camera is tilted very close to the ground, I want to make some ground parts transparent to show a buried object like a pipe.
libraries I am using: Mapbox Gl Js, Three.js
Have you tried to use the outline effect? It looks it could be what you need.