maierfelix / chromium-ray-tracing

Chromium build with hardware accelerated ray tracing
BSD 3-Clause "New" or "Revised" License
57 stars 4 forks source link

Is source for the web chromium-ray-tracing-demo available? #4

Closed mcclure closed 2 years ago

mcclure commented 2 years ago

The README links this demo. The source for it appears to be here, however, that demo uses your pure-Node version of webgpu.

Is source for the HTML-embed version of WebGPU-Path-Tracer available? If the HTML embed uses WebGPU-Path-Tracer, are there instructions or a script somewhere for doing the web build? Is it as simple as feeding WebGPU-Path-Tracer's index.js into a web bundler?

Thanks. (I'm interested in trying out the WebGPU path tracer, I'm starting with the node-only version but if I could get the HTML-embed version working that would enable easy simple test interfaces using eg React.)

mcclure commented 2 years ago

( Tried the node-only version of the WebGPU-Path-Tracer demo and got this error: https://github.com/maierfelix/WebGPU-Path-Tracer/issues/3 So as of right now the prebuilt Chromium works on my machine but node-webgpu does not obviously appear to. )

maierfelix commented 2 years ago

The html demo is indeed a web port of the node webgpu path tracer. Unfortunately I don't have the source of the port available anymore. Porting the code didn't take too long, but there are some small differences between the node webgpu bindings and the chromium/blink bindings that are tricky to spot. Instead, porting the RT triangle example should be a better introduction to the API.

The chromium RT build is the only option that still works up to today, since it uses DirectX instead of Vulkan for ray tracing. The Vulkan RT implementation was built with the VK_KHR_ray_tracing beta extension and so no longer works with the latest drivers, since the API has changed.

I wouldn't recommend using this project for anything else than experimenting. I never managed to complete it and when I started this project, Dawn's API and implementation was in heavy fluctuation. Dawn is in a much better and solid shape today, and it makes much more sense to start a RT proposal, specification and implementation today than it was a year ago.

mcclure commented 2 years ago

Understood, thanks.