Nathaniel Wilemon's Project

Title:Water Rendering

This is an animation. This project would be using dynamiclly changing terrain in order to render something looking like splashing water.
It would have red ambient lighting and the ball above would have bloom. The ball would slowley move and fall in the water, and have light passin through the water fade as it sinks.



I took the flag program, and modified the changed the x y z values to get it be horizontal. x scales with y, y is static, and z scales with x so it moves towards the screen.

I also removed font.h completly, and the text that appears on screen along with the felt. I set gravity to 0, and added code so that the wind will automatically flow left for a bit, then right for a bit.



I changed the code so the texture would repeat, and added a seamless water texture. The texture is shown on a 5 by 5 grid. I also made it so the texture moves towards the screen to help with the look of

the stormy and wavey water.

I changed the existing ambient light color to red, and added a red background for the sky using glClear.

I used the plasma.cpp to generate an image of a red sky with clouds, by changing what colors generated from black to dark red. I used quads to

create a giant wall near the back and applied the image from plasma.cpp on the texture.


I experimented with plasma.cpp more, to get a better background by setting the shades of red darker(150 r max to 100). I also changed the position

of the water to avoid issues where it would rise and overlap with the camera, and to center it better so it isn't cropped off on the side.

I made it less stiff and increased the wind speed to better get the stormish water.


I drew the arc the ball travels in by doing x = radius * cos(theta) and y = radius * sin(theta) where theta is an incremented global variable. Z is static

I then use this code to draw the ball at the coordinates.


To get the trail, we put the circle creation part of the code in a for loop to create circles behind the first one. I get the points behind

by decreasing theta, and decrease the gradually decrease the radius of the circles behind the first one. I also scale the color darker.


To get the new trail, I reduced the distance between each circle in the trail. I researched how to add transparency to textures in OpenGL, and added


glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); and
glEnable( GL_BLEND );

to enable transparency, using glColor4f instead where the fourth value is alpha.They fade by giving the newest circle a lower but equal RGB value that has a min of 0.35, and a lower alpha value until

complete transparency. I rewrite the circle-generation to make it 2d, so I can later add a fake bloom effect on the front circle using a transparent texture.


I used rainforest.cpp to add a function that allows me to do transparent textures. Using this I replaced the front circle with a star texture.

I used glDepthMask(GL_FALSE) to disable depth to fix the issue with the trail being red in the water, and the background blocking the trail. I also re-sized and readjusted the tranpsarent texture.

Final vid