A ray tracer built in Rust that can run in your browser via WebAssembly (demo).
Based on:
- My rust implementation of Ray Tracing In One Weekend
- My experiments with Rust + WebAssembly
- The excellent rpt ray tracer by Eric Zhang and Alexander Morozov.
- My experiments with
wasm-bindgen-rayon
to support multi-threading in Rust compiled wasm via rayon.
Requires npm
and rust
:
npm install
npm run dev
If you want to run the ray tracer natively in rust (rendered image is written to output.ppm
), run the following (available examples in crates/rrt/examples
):
cargo run --example --release scene1
Vercel doesn't play well when builds are run on their servers, so as a workaround, we can just build locally and deploy the local build via the vercel CLI:
vercel build
vercel deploy --prebuilt