the joy of environment maps
For my final project I decided to render simple primitives and place them in a realistic environment map. I have always felt that the primary strength of ray-tracing algorithms is their ability to simulate light reflecting and refracting accurately. Combined with real-world lighting, scenes containing even the simplest of primitives become very exciting.
I had enough time to finish a two-minute animation of my scenes, ``the joy of environment maps.'' It was produced using Bink and Windows Movie Maker.
This was the first opportunity for me to design and implement a complete renderer. I used the miro basecode for my renderer; however I have changed so many things that the code doesn't resemble what was given to me anymore. I felt that one of the biggest challenges during implementation was managing all of the different components of the renderer cleanly (materials, textures, objects, lights, camera, rendering parameters, etc). A big time saver was to generalize the given lexer and parser to make it as easy as possible to add in new materials, objects, and parameters.
Over the course of the quarter, I've implemented the following features:
- Triangles, Boxes, Spheres, Discs, and Rings
- Point, Disc, Sphere, and Directional Lights
- Lambertian, Specular, and Fresnel (reflection and refraction) BRDFs
- Solid Texture mapping
- BSP Trees (plus OpenGL visualization)
- Distribution Ray Tracing
- Path Tracing
- Photon mapping (global and caustics)
- Uniform (stratified) supersampling
- Environment Maps
- Loading and saving Radiance (HDR) format
Here are some images that I created over the course of the project. First, renderings with direct illumination:
After I implemented supersampling, I was able to get a nice image of a glass sphere. Note the Fresnel effects towards the edge of the sphere and the soft shadow on the floor.
Next, I implemented path tracing and photon mapping, and rendered a test scene with three spheres: one diffuse, one specular, and one transmissive. Here are the images side-by-side for comparison: the image on the left was computing using path tracing with 4096 samples, whereas the image on the right used photon mapping with 25 samples. Now the glass ball forms a caustic on the floor.
Photon mapping opened up many doors. Here is an interesting image of a glass dragon:
Once this was done, I implemented environment mapping and rendered the three spheres with the Grace cathedral environment map. Thanks to Paul Debevec for providing such beautiful environment maps! To sample the lighting in the scene, I used Structured Importance Sampling (thanks to Sameer Agarwal) with 10 directional lights. Notice in the image on the right you can see the multiple caustics formed by the glass sphere. For this scene (and the next two), I animated the scene by either moving the camera or the object (or both).
I was interested in rendering more caustics, so I rendered a specular ring with two small spherical light sources, with a nice marble floor underneath.
Finally, I decided to render a scene containing multiple concentric rings, each rotating about a different axis. I originally got the idea from Debevec's movie Fiat Lux and decided to match my skill against his. Here are some stills from my animation.