A simple ray tracer implemented in Rust, based on the "Ray Tracing in One Weekend" book by Peter Shirley.
- Ray-sphere intersection
- Lambertian (diffuse) and metal materials
- Antialiasing
- Depth of field
- Multithreaded rendering
- Rust (latest stable version recommended)
- Cargo (Rust's package manager)
-
Clone the repository:
git clone [email protected]:kayareyouokay/raytracer.git cd raytracer
-
Build the project:
cargo build --release
-
Run the ray tracer:
cargo run --release
The output will be saved as
output.pngin the project directory.
- The scene is predefined in
main.rs - You can modify the scene by editing the
mainfunction insrc/main.rs - Adjust image quality by changing
SAMPLES_PER_PIXELandMAX_DEPTHconstants
The ray tracer will generate an image file named output.png in the project directory. The image will show a simple scene with several spheres on a large ground plane.