Skip to content

nathanleiby/raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raytracer

This is an implementation of the Raytracer from Raytracing in One Weekend. It is written in Rust instead of the original C++. I used this as an opportunity to write a non-trivial amount of Rust code and consider some ways it differs from C++ (though I'm not at all experienced in C++).

I learned late into the project that Daniel Busch has translated the book into Rust. While I enjoyed my process of reading C++ and translating, which forced me to type out the Rust code and consider Rust patterns, I certainly found it useful to consult this implementation afterwards and see how it improved on my first pass. It also clearly shows how to add parallelism, which is one of the suggested improvements in the original book.

Usage

Run ./generate.sh to output a single ray-traced image.

With the default settings, this take ~90 seconds on a 2021 MacBook Pro with 16GB of RAM.

Example output

Example output

About

Raytracer from Raytracing in One Weekend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published