Conversation
|
@TheBlek - I'm going to call this "done" as a first pass, for now. There are some workarounds of three.js issues which are marked in TODOs but it's working fairly well. One of the features I'm liking the most about it is how scalable it is - we can reduce the amount of rays processed per frame based on framerate and the page can remain responsive since the whole 7+ bounce path doesn't need to finish in a single pass. Curious to hear your thoughts. The overall approach works like so:
-- A few things that need to be considered or added to aid with performance at some point:
-- I'll wait to see where you're going before putting too much more work into this path tracing logic specifically. I may look at some of the other points I mentioned in #705 (comment) when I have time. |
Remove usages of storage textures <rgba32float, read_write>
# Conflicts: # example/viewerTest.js # src/index.js
# Conflicts: # package.json
WebGPUPathTracer: export webgpu subpath
|
Here's another article from AMD on GPU-based path tracing that might have some good insight, as well: |
|
An open BSDF implementation from Adobe - maybe good for reference: https://github.com/adobe/openpbr-bsdf It only implements unidirectional pathtracing, though - not bidirectional. I'm not sure how complicated it is to derive the sibling PDF needed for bidirectional. |
WebGPUPathTracer: Calculate detailed sample counts
WebGPUPathTracer: Improve build performance, fix failures when rendering an empty scene
WebGPUPathTracer: Get megakernel working in Firefox, Safari
PathTracerMegaKernel: Remove all string-based dependencies
WebGPUPathTracer: Convert kernels to use wgsl tag fn
cc @TheBlek
I've branched from #705 and changed things around quite a bit to address the storage buffer limitations by using storage textures and organized kernels into dedicated classes. So canvas resize etc all works. I have also separated the "MegaKernal" from the "PathTracerCore" so it's easier it will be easier to follow the differences and dependencies between the implementations.
Next I'm going to look into some of the ideas around a ray queue we'd discussed previously. Then we can try some timing to see how things pan out.
Relatedly, this write up will be interesting for a wave front path tracer:
https://developer.blender.org/docs/features/cycles/kernel_scheduling/
Plans
Future