This raytracer was developed as part of the Raytracing course at HSLU and is inspired by the book Ray Tracing in One Weekend.
Before running the raytracer, make sure you have the following installed:
-
Rust: The raytracer is developed using the Rust programming language. Install it from the official Rust website.
-
FFmpeg: Required for converting animation frames to GIFs. Install FFmpeg from the official FFmpeg website.
Once these are installed, you can proceed with building and running the raytracer.
--release flag for significantly faster rendering performance.
cargo run --release -- --model box_vertex_colorscargo run --release -- --model suzanne --angle 45.0 --scene customcargo run --release -- --model suzanne --angle 45.0 --scene custom --animateEssentially, this is done if the --animate flag is set, but you can also do it manually.
First, generate a color palette:
ffmpeg -framerate 24 -i animation/frame_%03d.ppm -vf "palettegen" palette.pngThen create the final GIF:
ffmpeg -framerate 24 -i animation/frame_%03d.ppm -i palette.png -lavfi "paletteuse" animation.gifIf no arguments are passed, the app uses defaults defined in src/app/args.rs:
cargo run --release