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-rayonto support multi-threading in Rust compiled wasm via rayon.
Requires npm and rust:
npm install
npm run devIf 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 scene1Vercel 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