For this project I had planned to render an under water scene. I planned to include in the scene a view of the ocean floor and ceiling with a shark swimming towards fish.
The main areas of focus would include
As the semester progressed, I learned how lofty these goals were. Areas of project that I ended up working on include
Just to note I did get reflections on the ocean surface to work. I didn't include it in the above list simply because it comes from ray tracing transparent material which was part of the basic ray tracer. The foremention topics were all extensions of the ray tracer.
To get caustics working, I had to first implement photon mapping. The extension of photon mapping allowed for global illumenation and concetration of light after being shot through the glassy surface. Since I wasn't focusing on the global illumanation of photon mapping and since glassy surface covered the entire scene, I didn't implement two photon maps. I had a single map handling both global illumination and caustics.
Here's a simple example of a cornell box and which includes global illumenation and caustics. Note it has very few photon and very few samples which is why the box isn't as pretty as it could be.
Here are caustics effects when shining a single point light through a watery surface.
Better caustics may have been achieved with more light sources and higher concentration of photons.
A lot of time was spent in working with waves. From the beginning I expected I would use bump mapping to achieve the wave effect. I extened the ray tracer by adding both bump mapping and normal mapping. I attempted to use Fractal Brownian Motion (FBm) to generate a procedural texture for waves. I ran into issues with this when bumps did not mimic waves. They were either too tight or too loose. I eventually gave up on this and used a bump map image.
I did run across a paper describing the conversion of white noise to the frequence domain using a Forier Transform and applying physical wave models to mode the frequencies. Converting the frequencies back into the spatial domain and bump mapping those. It's not a procedural solution; however, it is supposed to tile nicely over large surfaces. Unfortunately there was no time to research this more.
This bumpy surface was crated using FBm on a very wide field. The gain was .8 and the lacunarity was 7.5
This is the same surface as above but with a dielectric material.
Again this bumpy were created by FBm bump mapping
These waves were created by bump mapping an image.
To get participating media to work, I use a combination of ray marching and photon mapping. I attempted to create a non-homogenous media by adjusting the step size of the to be -log (random (0,1)) / sigma_t. Further more I use Shlicks algorithm for a phase function. I used .05 for a scattering constant and .01 for an absorbtion constant. I was happy with ray marching results but was not able to get the photon volumn mapping quite right.
Simple ray marching creates a foggy effect.
Adding photons to scene creates some odd effects.
Here are some final images with all techniques combined. It's not exactly what I set out to accomplish. But it's getting there.
Shark exiting scene. Note the volumn photons are not getting through the wave plane.
Shark exiting scene. The waves were removed and the volumn mapping adds light contribution.