dorkhub

ray-tracing-in-one-weekend

Rust implementation of Peter Shirley's "Ray Tracing in One Weekend"

fralken
Rust936 forksupdated 3 months ago
git clone https://github.com/fralken/ray-tracing-in-one-weekend.gitfralken/ray-tracing-in-one-weekend

Ray tracing in one weekend, in Rust

This is an implementation in Rust of Peter Shirley's "Ray Tracing In One Weekend" book. This is the first of the series:

Every tagged commit is the code that generates a specific image. In this way it's easy to follow the progress in the book. First git clone this project. Then you can checkout a tag to retrieve the implementation at a specific chapter in the book. For example, with git checkout tags/chapter_08.2 you get the implementation for the second image of chapter 8. With git checkout master you go back to the latest version.

Instead of implementing my own vec3, I preferred using Vector3 from nalgebra crate. For random numbers I used rand.

Hence dependencies are:

What next

You can go on with my Rust implementation for the second book, "Ray tracing: the next week, in Rust".

Improvements

  • I easily made the main loop parallel with the rayon crate. Just make sure that Traits are marked Sync and then it's just a matter of using an into_par_iter() iterator.

Ray Tracing

more like this

anne-key

Firmware for Anne Pro Keyboard written in Rust

Rust572

TachiSnap

TachiSnap — Pixel Snapper for animation pixel artists. Rust + WebAssembly client-side tool for cleaning up AI-generated…

HTML50

bit_gossip

Pathfinding library for calculating all node pairs' shortest paths in an unweighted undirected graph.

Rust50

search

search projects, people, and tags