The goal of this assignment was to write shaders and to learn various techniques for performing surface perturbation and lighting tasks. Our extension animated waves and added a droplet type effect.
We modified our displacement mapping in our vertex shader so it now took in time as a parameter. With this new parameter we could express our height function as a function of position as well as time. The waves are created by a combination of sine and cosine waves and the droplet affect is also a sine wave that is a function of the distance from the center of the texture as well as time.
The following was used to generate the regular waves:
where val is the calculated height of the wave at point u v.
To calculate the droplet-like animation we used the following equation:
and this val4 was added to val( the final height of the point). To have the droplet-like effect fade out we used eased it out as we eased the other function in.