An implementation of the book Ray Tracing: The Next Week.
The following dependencies are mandatory:
- C++ compiler
- CMake (3.12 or greater)
Example snippet for building this project:
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX="/apps/CXXTemplate/" ..
cmake --build . -- VERBOSE=1 -j8 all install
The implementation to the prequel at RayTracingInOneWeekend.
Simulate the effect of motion blur, by introducing the concept of time to rays and scene objects.
Rays are fired at random times between shutter open and close to produce the averaged image across that time interval.
Scene objects now possess attributes. Attributes store values for multiple time samples, and supports queries between, or beyond available samples. For more information, see the class documentation for Attribute.
Introducing bounding volume hierarchy (BVH) to accelerate the ray tracing. The BVH reduces the number of intersection tests performed per-ray by pruning out hierarchies of scene objects whose bounding volume does not intersect with the ray.
With the same scene from 0. Motion Blur:
- With BVH: 10.575s
- Without BVH: 216.854s
Measurements taken using the time
Linux command line utility, on a Thinkpad X1 Extreme outfitted
with Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz.
Introducing textures to sample colors from. Textures are available as a type of material parameter, such as the "albedo" parameter for Lambert.
In the image above, the ground plane is assigned a Lambert material with a CheckerTexture for its albedo parameter.
Introduced a Perlin noise generator, for producing smooth noise.
By accumulating multiple layers of perlin noise applied to a sine function over the Z-coordinate, a marble-like texture is generated.
Introduced image based textures, which can be loaded from a file on disk.
During color sampling, the geometric surface coordinates (uv) are mapped to a particular image pixel coordinate.
Introducing emissive materials to provide local lighting to the scene, and a new Box scene object class.
Adding a ConstantMedium for a volume of particulates.
The ConstantMedium is associated with a geometric shape, and models ray hitting particles via a probability based on distance that the ray travels through the volume.
Any particle hit will cause the ray to be scattered in a random direction thanks to the new Isotropic material.
The final render, testing all the new features learned in Ray Tracing: The Next Week.
Rendered with 15,000 samples per pixel.
The implementation of the sequel is available under RayTracingTheRestOfYourLife.