This project extends a traditional recursive ray tracer to support special effects such as antialiasing, soft shadows, and caustic effect created by a photon map. The antialiasing is done by jittering the eye view position and then averaging the color to eliminate "jaggies". Soft shadows are done by jittering the shadow feelers to simulate an extended light effect to create the soft edge of the shadows. Finally, a photon map is used to create the caustic light under the sphere. A two pass algorithm is used to create the caustic. Photons are first shot out as rays from the light source into the transparent sphere to finally hit the flat surface undernearth the sphere where the photons are then stored. After, the photon map is built, the normal forward ray tracer then gathers the photons to finally create the caustic light effect.Acknowledgement
Antialiasing and soft shadows with extended light concepts were taken from: "3D Computer Graphics: A Mathematicla Introduction with OpenGL" by Samuel R. Buss Photon map implementation in C++ was taken from: "Realistic Image Syntesis Using Photon Mapping" by Henrik Wann JensenFinal Ray Trace Scene
This scene is inspired from the Palantir Stone in "Lord of the Rings". The all seeing eye is depicted inside the seeing stone.Non-antialiasing and Antialiasing
The antialiasing scene was created by randomly jittering the camera(eye) view 32 times per pixel. Each jitter was composed of picking two random scalar scaled to next up and right pixel vector. Since my scene had few objects, I was able to use more distributed rays instead of using the suggested fewer rays for the supersampling technique. As the above image shows, the anitaliasing results are acceptable.Non-soft shadow and soft shadow
The soft shadow was simulated by jittering the light source when computing the shadow feelers. Each light jitter was composed of picking three random scalars scaled in the x, y, and z direction.Caustic
The caustic was created by a two pass algorithm with the photon map. Rays were traced from the light source to the glass sphere where transmission rays were generated and then finally hit the flat surface below. At point of contact, photons are stored into the photon map. Then, during the normal forward ray tracing process, photons are gathered to estimate the radience if the ray happen to strike near a bunch of photons. The radiance estimate of photons is added to the normal radiance of the ray to create the color of the final viewing pixel.