Ray/Path tracing examples

A sequence of images showing the building up of features in a ray/path tracer to arrive at the capabilities needed to produce this final image.

Ray Casting (1 ray per pixel)

Display of simple lighting Display of normals


Display of distance along ray Display of object/color


Display glm::abs(rayDirection) Display intersection with object's bounding-box


Path Tracing (implicit paths only); Diffuse BRDF
Scene file for diffuse images


Paths are extended until they hit a light or give up trying. Even with a light large close in, most paths fail to find a light so the image starts with lots of black pixels.

Final image (right): 4096 passes; Others (below) at 1, 8, 64, and 512 passes.





Path Tracing (implicit and explicit paths); Diffuse BRDF
Scene file for diffuse images


Each extension of the path is accompanied by an explicit connection to a random point of a random light. Convergence is much faster than the previous implicit-only version.

Final image (right): 4096 passes; Others (below) at 1, 8, 64, and 512 passes.





Path Tracing; Reflection BRDF
Scene file for reflection images


The BRDF has been enhanced to include specular reflection as well as the original diffuse reflection. The sampling and Pdf have been chosen to match.

Final image (right): 4096 passes;
Others (below): 1, 8, 64, and 512 passes.





Path Tracing; Transmission BSDF
Scene file for transmission images


The BSDF has been further enhanced to include transmission through the surface, including refraction according to Snell's law and light attenuation according to Beer's law.

Final image (right): 4096 passes;
Others (below): 1, 8, 64, and 512 passes.





Path Tracing with MIS weights
Scene file for diffuse images



Multiple importance sampling (MIS) factors in a weight to pre-converge values toward the eventual average. Convergence is noticably faster for some scenes that include shiny/refractive images.

Final image (right): 4096 passes; Others (below) at 1, 8, 64, and 512 passes.





Path Tracing; Complex scene; Diffuse BRDF
Scene file for bvh test


Scene contains 208383 objects, mostly bunny triangles.

Final image (right): 4096 passes;
Others (below): 1, 8, 64, and 512 passes.





Timing information for each sequence of images

All images are 400x300 pixels.
All measurements were taken on a 3.2Ghz quad processor.
Series Total minutes passes/second minimumOnObject
average calls per ray
minimumOnVolume
average calls per ray
Implicit 20.4 3.35 8.97 20.41
Implicit+Explicit 35.7 1.91 8.91 20.26
Implicit+Explicit+MIS 36.3 1.88 8.91 20.26
Reflection 37.9 1.80 9.01 20.43
Transmission 40.0 1.71 9.26 21.33
Complex scene 122.9 0.56 8.10 114.12