I’m working on a 3D geographical data renderer with building models on a terrain surface. These building models are captured through photogrammetry, and a problem we have is that the terrain surface sometimes pokes through the building model since the surface data and building model don’t match exactly.
We want to mask away the terrain surface in the area that is covered by the building model footprint. I’ve been thinking of using the stencil buffer, maybe extruding some kind of shadow volume from the model and filling the z buffer with high values in the area covered by the building model’s footprint before rendering the model. This would require quite a bit of processing though, and I’m hoping that there is smarter and more efficient way of doing things. Another idea is making an orthographic 2d texture of the model rendered from above and using this to fill the z-buffer in some creative way using shaders.
So if anyone have done something similar before or have any ideas, I’d be real glad to hear them
I’m limited to OpenGL ES 3.0, so I can’t use geometry shaders or other fancy features.