This was the easy part. I used the same grid that I had created and added texture coords to every vertex. I added UV map coordinates to every vertex. I made the walls of the pool using this technique. Similarly I added a water plane to the pool. This is how it looked so far:
So far, so good.
I also wrote an exponential fog shader. This was required to simulate the decrease in visibility in underwater scenes. A few lines of fragment shader gave me the required effect. The other way to simulate underwater effect was to generate particles which can't be rendered at a decent FPS. So I had to stick to this fake fog shader.
Going deep down underwater:
Can't leave the Panda alone:
Another reason why I chose not to use particles for an underwater scene was the fact that it would have messed up the selecting objects feature. Since selecting the objects depends upon the rays sent from the camera to the object, the particles in between would have hindered the path. Without those particles, everything is as smooth as required.
There are still a lot of things that I will add to this underwater scene in later days including a reflection shader and an environment map. For now, I am happy to see this beta version of the scene come up in time.
What's next:
Animating the water texture.
Adding some controls for the pool to the GUI.