Skip to content
flyingrobotsPublic

About

Deterministic ray tracer: a Geordi runtime built on Bunny's fixed-point math.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lumen

Lumen is a ray tracer that renders the same image bytes on every machine: a Geordi runtime built on Bunny's fixed-point math.

The reference scene: a red sphere with a bumpy surface, a blue octahedron and a green Stanford bunny stand on a grey floor before a cream wall, under a pale blue sky.

The reference scene, lumen-reference-scene/4, 1280 by 720 at 64 samples per pixel.

A render has the same bytes, and so the same image hash, on every run, at every thread count, and on every platform CI checks: x86-64 and aarch64 Linux, aarch64 macOS, x86-64 Windows and WebAssembly (wasm32-wasip1). Each part of that claim is mapped to the tests that check it in the evidence map. Every sample is one diffuse path with a shadow ray and one bounce, all in Bunny's integer arithmetic, and the image is written as a PNG.

The three built-in scenes

Each image below is a render by Lumen at 1280 by 720, 64 samples per pixel and seed 0, re-encoded losslessly into a smaller PNG file. Its pixels are exactly the render's: the image hash is SHA-256 over the decoded RGBA8 bytes and identifies an image only together with its size (ADR 0009). Each output excerpt below is abridged: the two lines shown are exact, in the order the command prints them, and the other lines of the report are omitted.

The reference scene (above) is a bumpy sphere, an octahedron and the Stanford bunny before a wall.

cargo run --release -p lumen -- render --scene reference --width 1280 --height 720 --samples 64 --out reference.png
size 1280x720
image sha256:7d68fa3ab47c19ba6cee947836b49ad52e4e0891f2a4b41562192576d1700a6e

Fixed Point is the full-resolution bunny in sunglasses at a craps table.

Fixed Point: a white Stanford bunny in black sunglasses sits on a green craps table with white betting lines and numbers, an ON puck and two red dice in front of it.

cargo run --release -p lumen -- render --scene fixed-point --width 1280 --height 720 --samples 64 --out fixed-point.png
size 1280x720
image sha256:86cdfd58d7745297b52f63f443cedd789a773996c66ad57d45b5d8a6f67fb153

The canyon is three craft flying along a fractal canyon under a banded planet (566 005 triangles).

The canyon: an orange, a white and a teal craft fly down a rocky brown canyon under a banded planet in a dark sky, and a white bunny sits on a ledge at the left.

cargo run --release -p lumen -- render --scene canyon --width 1280 --height 720 --samples 64 --out canyon.png
size 1280x720
image sha256:1bd910dcea9c3daaa3ea57e3972a639202aa341ba59e0e075a2e55184dc56446

Render an image

With a Rust toolchain (rustup; the checkout pins Rust 1.96.0):

git clone https://github.com/flyingrobots/lumen
cd lumen
cargo run --release -p lumen -- render --out first.png

The report holds the image hash of the reference scene at the default 320 by 180, 4 samples per pixel, the same on every platform CI checks (abridged: the two lines shown are exact, and the other lines of the report are omitted):

image sha256:d6e4ff7d768e266a30e54a04d62f6a13aeeebd2f6f68f8783faaaff9c7f505a8
png first.png (230699 bytes)

To render all three scenes at the size above, run the three commands in the previous section; the canyon takes the longest. Maintainers with the container runner devrun run make demo, which renders them into out/ and opens each image.

The tutorial goes on from there.

Documentation

License

Apache-2.0. See LICENSE.

The Stanford Bunny mesh in assets/stanford-bunny/ is not covered by that license: it is from the Stanford 3D Scanning Repository, Stanford Computer Graphics Laboratory, and is used with attribution. See assets/stanford-bunny/README.md.

The PBR Stanford bunny in assets/stanford-bunny-pbr/ is not covered by it either: it is "Stanford Bunny PBR" by hackmans on Sketchfab, licensed CC BY 4.0, and derived from the Stanford Bunny in Morgan McGuire's Computer Graphics Archive. Credit the author where it is used. See assets/stanford-bunny-pbr/README.md.

About

Deterministic ray tracer: a Geordi runtime built on Bunny's fixed-point math.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages