Skip to content

ahuth/raytrace2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raytrace 2

Follow-up to https://github.com/ahuth/raytrace, this implements a raytracer by following Ray Tracing in One Weekend, by Peter Shirley.

Ray-traced image of a bunch of random spheres made of different materials

Usage

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.

Screenshots

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 13.1

  • Section 12.2. Add a depth of field effect.

    section 12.2.

  • Section 11.1. Add the ability to move the camera around, and point it at different directions and angles.

    section 11.1

  • Section 10.5. Use two glass spheres to create a hollow sphere.

    section 10.5

  • Section 10.2. Add glass as a material.

    section 10.2

  • Section 9.6. Add "fuzziness" to reflections off of metal spheres.

    section 9.6

  • Section 9.5. Add metal spheres that reflect light.

    section 9.5

  • Section 8.3. Use gamma correction to get correct color intensities.

    section 8.3

  • Section 8.2. Add diffuse materials. These are matte and light bounces off of them in random directions.

    section 8.2

  • Section 7.2. Average together multiple samples for each pixel, resulting in a smoother looking image.

    section 7.2

  • Section 6.7. Add a second sphere representing the ground.

    section 6.7

  • Section 6.1. Shade the surface of a sphere.

    section 6.1

  • Section 5.2. Actually draw a ray-traced sphere!

    section 5.2

  • Section 4.2. Send rays into a scene and use them to draw a blue gradient.

    section 4.2

  • Section 3. Draw a color gradient.

    section 3

About

Implementation of ray tracer from Ray Tracing in One Weekend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published