How would you go about doing multi pass rendering in OpenGL for a basic
terrain engine. From what I hear, Quake III does all it’s own fog code
simply because GL_FOG compliance cannot be guaranteed on all cards. This involves doing multipass
rendering over a textured surface.
I’m sure programs that use multi pass rendering draw a textured poly and
then draw another poly (this time a flat shaded poly who’s colour matches
the fog colour and who’s opacity varies with distance) over the top of the
Can this be done whilst still using the OpenGL depth buffer?
If one draws the entire landscape and then draws it again but flat shaded
with varying opacity I imagine the depth buffer will go super glitchy as it
tries to decide which poly is on top of which.
I thought about going through every polygon in the terrain, drawing a
textured poly, turning off the depth buffer, drawing a fog coloured poly
over the top, turning the depth buffer back on and moving onto the next poly
but I think that the method would be slow, not to mention the fact that it
may not work at all.
Any thoughts, or even URLs for that matter?