The Ray Tracer Challenge (Jamis Buck)

My intention is to write my own raytracer. There is plenty of sources to get started, Jamis Buck's book being one of the best. It is a test-driven approach where one can choose the programming language one likes.

 

A few babysteps to put you on the way.

1) Start with a pointlight and a Phong Reflection Model.

2) Add a scene, camera, canvas and some rudimentary shadows.

3) Add patterns or color gradients to the floor and objects.

4a) Add reflections to planes.

4b) Add reflective material to some spheres.

5) Add refractive properties.

6) Constructive solid geometry makes it possible to model complex shapes by making use of Boolean operators to combine geometric primitives. In the below example a red sphere is subtracted from a blue sphere.

7) A polygon mesh is a collection of vertices, edges and faces that define the shape of a polyhedral object's surface. This example showcases a chair and a cottage that consist out of a few hundred triangles.

8) A bounding box is generated around each object. If a ray does not strike the bounding box, intersections will not be calculated.

Bounding Volume Hierarchies makes it possible to only calculate intersections when a bounding box of a small subset of objects is being hit without calculating all the other intersections.

This considerably improves rendering times of scenes mith many objects being displayed.

At this point, I am moving away from the Phong Reflection model for shading since it does not conserve energy and does not produce physically accurate images. With our quest for better photorealism, we will move to physics based rendering which is of course computationally more demanding.