Raytracers in Rust.
Rust
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/bin
.gitignore
.travis.yml
Cargo.lock
Cargo.toml
LICENSE.md
README.md
raytracer_2d.jpg
raytracer_pinhole.jpg
raytracer_pinhole_path_10k.jpg
raytracer_pinhole_path_5k.jpg

README.md

Raytracers in Rust

Build Status

This repository contains a few very simple raytracer implementations written in Rust. They are listed here in increasing order of complexity:

  1. raytracer_2d.rs: The simplest possible (?) raytracer that produces a 2D image with orthographic projection.

  2. raytracer_pinhole.rs: Similar to raytracer_2d.rs but now we use a pinhole camera model for capturing the image. Also added a light source and implemented simple phong shading.

  3. raytracer_pinhole_path.rs Implements path-based ray tracing by recursively following rays up until a maximum depth of 4. Rays are sampled randomly using a monte-carlo based approach.

    5k samples 10k samples

The code is inspired by the book Realistic Ray Tracing (2nd Edition) by Peter Shirley and R. Keith Morley and the smallpt project.