A simple ray tracer written in Rust following the Ray Tracing in One Weekend book series by Peter Shirley.
The ray tracer generates a random scene filled with spheres and leverages Rayon to deliver parallel computations.
An image with the following configurations renders in ~382 seconds in a Core i7-12700H spawning ~20 threads:
- W x H: 1200 x 800
- Samples per pixel: 500
- Recursion depth: 50
- Shapes: 486
Motion Blur and Checkered Textures:
- W x H: 800 x 450
- Samples per pixel: 400
- Recursion depth: 70
- Shapes: 486
- Render time: 21 minutes
Progress bar indicator:
- Build project:
cargo build --release
. - Configure ray tracer:
- Edit
config.toml
to set image width, image height, recursion depth, samples per pixel and scene to be rendered. - Copy
config.toml
to target directorytarget/release
.
- Edit
- Render image:
./target/release/app
. - View image:
./target/release/image.ppm
.