Introduction to Raytracing
This lab will be a primer for the raytracer assignment assigned in class. You will be implementing a basic raytracer that can render an implicit sphere using the Phong lighting model.
Download the starter code and this PDF document.
You will presented with the following upon running the starter code:
These wireframes are drawn using OGL and are there to assist you in debugging your raytracer. The sphere mesh represents the implicit sphere that you will be raytracing, and the eight-sided polyhedron represents the point light source. You will only want to set the pixels which have corresponding rays that intersect the object so that you do not overwrite the helpful grid and light indicator. You will need to implement the code necessary to render the sphere by reading through the above PDF document. This document will provide you the details necessary to complete the assignment.
Your first step should be to correctly detect which rays have intersected the geometry and color the corresponding pixels with some specified color.
You will then need to implement the Phong lighting model. Your results should closely resemble the output below.
To get you started, I have provided you with the code necessary to compute the rays and the camera transform. You will only need to compute intersections, and apply lighting. I will discuss their computation and usage in lab.