The initial goal was just to render a simple 3D scene in the browser at a reasonable frame rate. It evolved into a small renderer that can: • Run locally or on the web using wgpu and WebAssembly • Perform mesh rendering with a Bounding Volume Hierarchy (BVH) for acceleration • Simulate both direct and indirect illumination for photorealistic results • Be deployed easily as a free web demo using GitHub Pages
The project is far from perfect, but it’s been a fun way to dig deeper into graphics programming and learn more about Rust’s ecosystem. I’m also planning to experiment with Rust for some ML projects next.
GitHub: https://github.com/tchauffi/rust-rasterizer Web demo (desktop browsers): https://tchauffi.github.io/rust-rasterizer/
Would love feedback from anyone who’s built similar projects or has experience with wgpu or ray tracing in Rust.
In Chrome I get "Failed to start: Failed to create State. Caused by: failed to find GPU adapter."
So I guess it runs on "some" GPUs, in "some" browsers!
```
live_raytracer-bffaca82311af1dd.js:1484 Uncaught Error: Using exceptions for control flow, don't mind me. This isn't actually an error! at imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 (
```
but everything else is fine
Recommend taking a few minutes to make the web page work on mobile.
For example on iPhone the actual webgpu/ray tracing seems to work fine but html formatting is shoving things over to be barely visible.
Seems pretty clickbaity and dishonest when that's just what webgl and webgpu means. Just say webgpu.
Also the roughness doesn't apply to the environment map.
The title implies that the reason this exists is because it "runs on any gpu, even in the browser". People have been making raytracers using gpu apis in the browser over and over for the last decade.
That would be like someone claiming their program "multiplies huge matrices using SIMD" and then wrapping eigen. Why make a claim that is just happening because you call the same library as everyone else?
Written in Java then transpiled to JavaScript, been around for years.
Your link appears to be a basic ray tracer which anyone who has taken an intro to computer graphics course in college is likely required to implement and would only need a javascript canvas. To be honest I have no idea how much OPs real-time ray tracing differs in complexity from traditional ray tracing.