Fundamentals of Ray Tracing

Chapter 1: Introduction

Chapter 2: Digital Images
2.1 Pixels and colors
2.2 An example
2.3 Resolution

Chapter 3: Cameras, Eyes, and Ray Tracing
3.1 Images distort reality
3.2 Perspective in art
3.3 Cameras

Chapter 4: Vectors and Scalars
4.1 Scalars
4.2 Vectors
4.4 Vector subtraction
4.5 Scalars multiplied by vectors
4.6 Vector magnitude
4.7 Unit vectors
4.8 Vector dot products
4.9 Vector cross products
4.10 Sine and cosine: a crash course

Chapter 5: C++ Code for Ray Tracing
5.1 Platforms and redistribution
5.3 Building on Windows
5.4 Getting ready to build under OS X
5.5 Building on Linux and OS X
5.6 Running the unit tests
5.7 Example of creating a ray-traced image
5.8 The Vector class
5.9 struct LightSource
5.10 The SolidObject class
5.11 SolidObject::AppendAllIntersections
5.12 struct Intersection
5.13 Scene::SaveImage
5.14 Scene::TraceRay
5.15 Saving the final image to disk

Chapter 6: Sphere Intersections
6.1 General approach for all shapes
6.2 Parametric ray equation
6.3 Surface equation
6.4 Intersection of ray and surface
6.5 Surface normal vector
6.6 Filling in the Intersection struct
6.7 C++ sphere implementation
6.8 Switching gears for a while

Chapter 7: Optical Computation
7.1 Overview
7.2 class Optics
7.2.1 Matte color
7.2.2 Gloss color
7.2.3 Avoiding amplification
7.2.4 Opacity
7.2.5 Splitting the light's energy
7.2.6 Surface optics for a solid
7.3 Implementation of CalculateLighting
7.3.1 Recursion limits
7.3.2 Ambiguous intersections
7.3.3 Debugging support
7.3.4 Source code listing

Chapter 8: Matte Reflection
8.1 Source code listing
8.2 Clear lines of sight
8.3 Brightness of incident light
8.4 Using CalculateMatte's return value

Chapter 9: Refraction
9.1 Why refraction before reflection?
9.2 Understanding the physics of refraction
9.3 Snell's Law adapted for vectors
9.3.1 Introduction to Snell's Law
9.3.2 Refractive reflection
9.3.3 Special case: total internal reflection
9.3.4 Setting up the vector equations for refraction
9.3.5 Folding the three equations into one
9.3.6 Dealing with the double cone
9.3.7 Constraining $\mathbf{F}$ to the correct plane
9.3.8 Reducing to a scalar equation in $k$
9.3.9 Picking the correct solution for $k$ and $\mathbf{F}$
9.4 Calculating refractive reflection
9.5 Ambient refractive index
9.6 Determining a point's refractive index
9.7 CalculateRefraction source code

Chapter 10: Mirror Reflection
10.1 The physics of mirror reflection
10.2 Two kinds of reflection, same vectors
10.3 Deriving the vector formula
10.4 Recursive call to CalculateLighting
10.5 CalculateReflection source code

Chapter 11: Reorientable Solid Objects
11.1 The challenge of rotation
11.2 The SolidObject_Reorientable class
11.3 Implementing a rotation framework
11.4 Complex numbers help rotate vectors
11.5 Rotation matrices
11.6 Translating between camera coordinates and object coordinates
11.7 Simple example: the Cuboid class
11.8 Another reorientable solid: the Cylinder class
11.9 Surface normal vector for a point on the tube surface

Chapter 12: The TriangleMesh class
12.1 Making things out of triangles
12.2 Intersection of a ray and a triangle's plane
12.3 Determining whether a point is inside the triangle
12.4 The surface normal vector of a triangle
12.5 An ambiguity: which perpendicular is correct?
12.6 Example: using TriangleMesh to draw an icosahedron
12.7 Using TriangleMesh for polygons other than triangles

Chapter 13: The Torus class
13.1 Mathematics of the torus
13.2 Intersection of a ray and a torus
13.3 Solving the quartic intersection equation
13.4 Surface normal vector for a point on a torus

Chapter 14: Set Operations
14.1 A simpler way to code certain shapes
14.2 SetUnion
14.3 SetIntersection
14.4 The SolidObject::Contains member function
14.5 SetComplement
14.6 SetDifference
14.7 Combining set operations in interesting ways
14.8 A set operator example: concrete block