rust-raytracer-weekend icon indicating copy to clipboard operation
rust-raytracer-weekend copied to clipboard

My Rust implementation of Ray Tracing in One Weekend by Peter Shirley.

Rust ray tracer

I'm learning Rust and decided to tackle the classic Ray Tracing in One Weekend project by Peter Shirley. All the algorithms and general code structure are from that book, just translated the examples from C++ into Rust. I haven't written a ray tracer before, but I hope to reimplement it in a few other languages after Rust, like Zig and the language I know best, JavaScript, just for a performance comparison.

It supports command-line and WebAssembly.

Blog posts

Example renders

Here are some renders, some are to document subtle bugs, and some are just to celebrate first successful renders with new features!

first hires reflective fixed metal reflectance wooooo first render with materials and attenuation first render with materials first-hires-render-with-clean-shadows 5-raycolor-multiplier shadow-acnestriations-caused-by-shadow-acne bad-fix-for-shadow-acne gamma-correction 24m-striations hires-bounces-with-striations first-with-bounces-yaaaaaay now-with-AA oh-just-flubbed-normal-colors oh-just-noramsl ahhhh-the-blood-sun ahh-a-nice-sunny-day first-render