- Antialiasing: Smooths out jagged edges by casting multiple rays per pixel.
- Reflections and Shadows: Simulates the behavior of light by calculating when light bounces off reflective objects or is blocked by an object.
- Configurable Camera: Allows adjustment of the camera's position, orientation, lens, and field of view to capture various types of shots.
- Various Materials: Use different materials including shiny metals, diffuse Lambertian surfaces, or glass-like objects that handle light reflection and refraction.
This is a simple ray tracer written in Rust guided by the implementation of the "Ray Tracing in One Weekend" series by Peter Shirley. I developed an interest in computer graphics early on in my computer science coursework in school, so this project is a way to explore that interest while also learning some Rust along the way! The goal of the ray tracer is to render realistic looking images that imitate the way light interacts with various complex surfaces and textures. Above are example renders that demonstrate what the ray tracer is currently capable of.
I am currently a senior studying math and computer science at UChicago, and I am interested in pursuing a career in software engineering and technology more broadly. Feel free to message me via LinkedIn!
Simply clone the repository and load the necessary Rust packages to begin working with the project:
git clone https://github.com/alexmstern/ray-tracer.git
cd ray-tracer
cargo build
You can render different scenes by changing the scene
variable in main.rs
to the corresponding scene in the scenes
folder. Play around with the settings to get a sense for how the different variables affect the scene and feel free to create your own scenes! Once you have done that render your image with the following commands:
cargo build
cargo run