Here's a little info about my final project for CSE 168, for which you see the final result above. I Used the base code of miro that was given to us, and the code that I added throughout the quarter, such that my final renderer can handle raytracing: triangles, triangle meshes, boxes, and spheres; reflections, shadows, multiple lights, traversing a BSP tree to speed up triangle rendering, cube-mapping, ocean heightfield generation, texturing, etc.

My project consisted of using an accurate model for ocean waves to generate a random ocean and I also added in glossy reflections. I didn;t get to adding in the optic effects at the ocean surface that I wanted, but the final image still ended up looking pretty good in my opinion. I was originally going to do a picture of accurately modeled clouds but when I talked to Henrik, he let me know that I was probably getting in over my head. He instead suggested that I implement a deep-water ocean surface, pointing me in the direction of Jerry Tessendorf's paper on the subject from SIGGRAPH.

I searched for the paper for a while without success, since the webpage that everyone links to seems to be broken. I finally found it on another university's class notes. I place it here with the hope that someone else can find it when they decide to implement the technique :).

The first things I implemented were seperate materials and glossy reflections. Here are some test images that I had made:

Here's a glossy sphere test:

I then decided to dive head into using Tessendorf's ocean generating technique, which involves building up a grid of frequency spectrum information and then taking the Fourier transform of that to get the heightfield out. The spectrum data comes from the Phillips' spectrum which is an empircally found model for deep ocean waves.

In the paper the math is complicated a bit since it is presented with the ability to be animated, which I didn't need to implement in this renderer. So after some simplifications I ended up with an equation to fill in the grid with the appropriate values. Here are the first two tests without smooth normals

Obivously alot more needed to be done. I tried to implement the normals using the spectrum stuff that Tessendorf talks about, but I was having problems as can be seen in the next test:

Finally I went with just generating the x and z gradient arrays using the heightfield array values, which although not as accurate, doesn't seem to have made a huge difference. Much better than the black patches I was getting before:

I then started playing around with textures and trying to get everything to look the way I wanted it, my progress can be seen in the following images.

I started playing with the glossy code to get the sphere to look a bit better. In my head I had wanted the sphere to have a bumpy glossy look, this ended up happening without me having to add in bumpmapping since randomness of the glossy rays gives it that look anyways with the number of samples I used.

So after a bit more tweaking I finally got a picture I was pretty happy with, although if I had more time I would have added in the refraction code at the surface to make the ocean look better. I also would have liked to added in more shininess from the sun location. Again, here is the final image