I am writing webgpu ray tracer, is anyone interested in this topic?

is there anyone willing to support the development of open source webgpu ray tracer ?

(preview online demo (no bvh yet) is available here (link), by subscription for only one Euro for free) :smiley:

WGSL GPGPU LBVH Building & Traverse underway

(babylon.js is used to access webgpu)


Cool project! You could share the github repo if available?

(BVH hasn’t ported yet, I’m porting it from my previously unpublished opencl RTRT application, but it also requires writing a WGSL version of radix sort, because the Boost.Compute library was used for this earlier)


You can find them in this webgpu issue

specifically the dawn-ray-tracing project :

firstly, it requires custom chrome build

secondly, it requires support for ray tracing in video card drivers


well, I wanted to implement hardware agnostic software gpgpu ray tracing requiring only support for WGSL compute shaders :smiley:

that‘s great!But The larger the heightand width of the webpage, the worse the performance。When I maximize the webpage,I got 18 FPS。

I think that’s expected, as more width and height = more pixels to go over

seen webrtx under webgpu ? :grin: (released 4 months ago)

example from description


also works on compute shader,

WebRTX is not hardware ray tracing and is a pure compute shader implementation. This means WebRTX works as long as your browser supports WebGPU (only tested on Chrome so far).

but again without GPGPU BVH Building apparently

The building of BVH happens on host which is then flattened into a buffer for stackless traversal on GPU.

the implementation is tricky, of course :smiley: although we can say that this is a professional approach (in that tracing can be written on GLSL shaders, even if it is not supported in drivers), but taking into account the CPU’s BVH build, this is of course still quite useless …

### Code structure
  • /bvh - Rust code for building BVH and serializing it to a format suitable for stackless traversal on GPU.
  • /glsl - Rust code for parsing and manipulating user provided shaders.
  • /naga - WASM binding for naga, based on wasm-naga.
  • /src - All other typescript library code.