This is a toy ray tracer written in Rust, following "Ray Tracing in One Weekend"
Spheres, shaded by their normals, with no antialiasing
Spheres, shaded by their normals, with antialiasing
Mirror spheres, no gamma correction
Lambertian spheres, with gamma correction
Lambertian and mirror spheres
I used these sources for reference and inspiration to help me with this project. For the more core ray-tracing part, I used the classic book Ray Tracing in One Weekend. I also referenced a tutorial on writing a ray tracer in Rust, since I wanted to make sure I was using proper Rust conventions when writing this.
For the rendering side, I referenced the classic pbrt book, as well as information from Dartmouth's CS87 rendering course, taught by Wojciech Jarosz.
I'm also using nalgebra as my linear algebra library.
To run tests:
cargo test
To build:
RUSTFLAGS="-C target-cpu=native" cargo build --release
To run:
RUSTFLAGS="-C target-cpu=native" cargo run --release
In order for the renderer to be able to output images, you will need to create the output folder, otherwise it will panic and fail.
mkdir renders