Follow-up to https://github.com/ahuth/raytrace, this implements a raytracer by following Ray Tracing in One Weekend, by Peter Shirley.
Generate the image by running the following command:
yarn build
A git-ignored image.ppm
file will be generated at the root of the project.
These images were captured at various points in the book. Here they're listed in reverse order, so the earliest sections are at the bottom.
-
Section 13.1. The final render.
-
Section 12.2. Add a depth of field effect.
-
Section 11.1. Add the ability to move the camera around, and point it at different directions and angles.
-
Section 10.5. Use two glass spheres to create a hollow sphere.
-
Section 10.2. Add glass as a material.
-
Section 9.6. Add "fuzziness" to reflections off of metal spheres.
-
Section 9.5. Add metal spheres that reflect light.
-
Section 8.3. Use gamma correction to get correct color intensities.
-
Section 8.2. Add diffuse materials. These are matte and light bounces off of them in random directions.
-
Section 7.2. Average together multiple samples for each pixel, resulting in a smoother looking image.
-
Section 6.7. Add a second sphere representing the ground.
-
Section 6.1. Shade the surface of a sphere.
-
Section 5.2. Actually draw a ray-traced sphere!
-
Section 4.2. Send rays into a scene and use them to draw a blue gradient.
-
Section 3. Draw a color gradient.