MrShoe
07-15-2002, 12:12 AM
I have a problem, i want to implement water reflections in my terrain engine.
I basially at the moment have the terrain mesh ad one large water quad stretching over
at a certain height over the entire mesh.
Anyway, usully what you do:
Draw the terrain mesh
label all water quad pixels as 1 in teh stencil buffer.
Draw the height mesh again with negative heights this time. (if the water quad is
at 0 height) but only over the water quad pixels.
Then you would draw the water uad with alpha blending on.
Anyway, you cant do this with a terrain engine. This isbecaus the original mesh
will cover over the reflection mesh, this is because the original mesh goes continues
under the water as well.
Anyway, the closest i have come to a solution is to simpy say only draw thos parts of
the terrain mesh which are above the water quad, and not those below. Then it kinda works
but rather obviously it aint pretty :-) because this will produce jagged polygon cutoffs
in the terrain mesh.
Anyway, does anyone know how to solve this dilema?
I basially at the moment have the terrain mesh ad one large water quad stretching over
at a certain height over the entire mesh.
Anyway, usully what you do:
Draw the terrain mesh
label all water quad pixels as 1 in teh stencil buffer.
Draw the height mesh again with negative heights this time. (if the water quad is
at 0 height) but only over the water quad pixels.
Then you would draw the water uad with alpha blending on.
Anyway, you cant do this with a terrain engine. This isbecaus the original mesh
will cover over the reflection mesh, this is because the original mesh goes continues
under the water as well.
Anyway, the closest i have come to a solution is to simpy say only draw thos parts of
the terrain mesh which are above the water quad, and not those below. Then it kinda works
but rather obviously it aint pretty :-) because this will produce jagged polygon cutoffs
in the terrain mesh.
Anyway, does anyone know how to solve this dilema?