Water |
On this example, i added a reflective water effect. The theory behind is very well explained on a article on gamedev.net by Yann Lombard ( http://www.gamedev.net/columns/hardcore/rnerwater1/ ). The algorithm is the following :
Details :
The following pictures are going with the options i have incrementaly added. First ones are pretty simple and the last one is the more advandced. Of course, the animation of the water is better to see in real-time that on screenshots, but i need to optimize a bit the program...
download : water.ace ( 2302ko) (exe+source+projet Visual C++ 6.0)
download : water.ace ( 2225ko) executable version with MFC to set up parameters (shadow, transparency, wave model...)
overview of the results ( reflective water and transparency, no clouds, water is not disturbed) |
water is too transparent here, it's
hard to get what is reflection and what is the under-water ground ( reflective water and transparency, no clouds, water is not disturbed) |
water is very reflective here and
hardly not transparent ( reflective water and transparency, no clouds, water is not disturbed) |
water is at the maximum of
reflection, details of the moutains in the water are well represented ( reflective water, no transparency , no clouds, water is not disturbed) |
water is at the maximum of
transparency, the green texture of the under-water part is good looking ( reflective water and transparency, no clouds, water is not disturbed) |
same as previous one but with a bit
less transparency ( reflective water and transparency, no clouds, water is not disturbed) |
reflected sky ( water is purely
reflective here), in the upper-left corner, one can notive an edge of
the sky-box. ( reflective water and clouds, no transparency, water is not disturbed) |
the almost final picture :
tranparency, reflection (mountains and sky), shadow... ( reflective water and transparency, clouds, water is not disturbed) |
zoom on a fine part, one can notice
an artefact on the left side of this picture, where water is meeting
the mountains, some pixels are visible... ( reflective water and transparency, clouds, water is not disturbed) |
one can notice here that the reflection is perturbated. |
evrything is turned on, except that under-water part is not perturbated |
on this picture, i add perturbations to the under-water part |
the final picture : everything is
turned on
|
a little problem : because coordinates are perturbated before being passed to the projective matrix, this blue-sky pixels appear. |
To correct this, i set the clipping plane a bit under the water plane when rendering the inversed upper-side of the world |
Author : Adrien
Auclair
adrien.auclair at club-internet.fr
Last update : 15/10/2004