A Simple RayTracer

Introduction

Ray Tracing is a technique of casting light rays through pixels in order to determine the color and shading at that pixel. This strategy is used to render high detailed still images but not optimal for real-time graphics. The program casts rays from the viewport and detects if that ray intersects with an object. If it does, a ray is cast from the light source to the point of intersection and the color is computed using the Phong model. Shadowing is calculated by casting a ray back to the light source. If the ray hits an object before reaching the light source, it is in a shadow.

Solution

My solution can render images with spheres and planes in the scene. It uses the Phong model to determine the coloring and shading of the object. Also, shadowing was completed for both spheres and planes.

Outcome





References

Ray Tracing (Graphics). http://en.wikipedia.org/wiki/Ray_tracing_(graphics)

What is Ray Tracing. Codermind team. http://www.codermind.com/articles/Raytracer-in-C++-Introduction-What-is-ray-tracing.html

Ray-Sphere Intersection. http://wiki.cgsociety.org/index.php/Ray_Sphere_Intersection

Ray Intersection. http://www.cs.toronto.edu/~smalik/418/tutorial8_ray_primitive_intersections.pdf