
Basic Ray Tracer
Write a ray tracer that displays basic shapes, lights, and materials. Ray tracing is, in some sense, the most natural way to generate images. By generating and casting rays, the ray tracer is able determine what color we would see if we looked in some direction from some point of view. Within the accuracy of the scene and shading models and with enough computing time, the images produced by a ray tracer can be physically accurate and can appear indistinguishable from real images. The ray tracer you are required to write for this assignment will not be able to produce physically accurate images since it is very basic, containing just the key elements regarded to be a ray tracer.
Minimally, your ray tracer must have support for:
- Spheres
- Cubes (assume these are aligned with the coordinate axes)
- Lambertian (diffuse) materials
- Phong (specular) materials
- Point lights (that provide illumination that does not fall off with distance)
All data regarding the scene to be traced should be read from a data file. You do not need to worry about malformed input, either syntactically or semantically. For instance, you will not be given a sphere with a negative radius or a scene without a camera. Additionally, you do not have to worry about the camera being inside an object.
You will be given a coding framework to spare you from the mundane details of GUIs, I/O, vector arithmetic, etc. However, you will need to complete all of the methods of the ray tracer yourself. Feel free to create whatever new classes you think are necessary, change parameter lists, etc. In the end, if your program works, and is understandable, you will receive full credit. Be aware, though, that while there is no one “right” way to do this assignment, there are many incorrect ways to do it.
Extra Credit
There are many possible additions to the basic ray tracer. You can earn bonus points with extremely creative or artistic solutions. Make sure that you mention your assumptions, extra features, and how to run your program (especially with regard to command line arguments) in your README file.
To get you started, here are some extra credit ideas:
- Create new and creative data files to test/show-off your project
- Support reflection among objects (i.e., mirrors)
- Support refractive objects (i.e., transparency)
- Intersect with more complex surfaces (i.e., cylinders, cones, or arbitrary functions)
- Use images to define textures (colors) on your objects
- Worry about efficiency; there are many optimizations that you can do to minimize the number of objects you must intersect with or the number of calculations each intersection requires