So going on to the most complicated
thing, Pool Surface. Using a similar method that was described by
Christian
, I basically followed the same procedure, creating a reflection,
refraction image ( rendered to texture using Framebuffer Objects.
Here's some screen captures from the FBOs.
Refraction
buffer
Reflection buffer with a clipping plane
I feel like this method is a bit kludgy, but again, time was running
short. I tried to incorporate my own calculations of the Fresnel
term, so I think that's why the colors are a bit on the bright
side. Also, I modify how much of the reflection is visible when
your are underwater or above water. I did successfully get the
refraction above water to show up, although again summing up the colors
from reflection and refraction buffers washes out the color a
bit.
To move around, use the 'WASD' style control and use the mouse to look
around and in the direction you want to move. To run the program
after you make it, you can type 'make run.'
Cool, now that that's all done. Well, we're done. For the
normal map generation here is
the code.
Here is
the
source code, The code should work
on Mac OS X, Linux
(32 bit & 64 bit). In order to build the application you will
need libpng and the
SDL library.
On the
Mac you can use Fink, or install from source. Depending on which
version of Linux you are using, you could probably install both via a
package manager (e.g. apt-get, yast2, etc.).