MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

MaterialX WebGL Path Tracer

Open jstone-lucasfilm opened this issue 1 year ago • 3 comments

Now that the MaterialX Web Viewer is available for quick validation of MaterialX content in the browser, an especially valuable next step would be the contribution of a WebGL Path Tracer that generates corresponding path-traced renders.

One potential starting point for this project is the three-gpu-pathtracer by Garrett Johnson, which provides the fundamental building blocks for path-traced rendering using Three.js.

Another good role model is the OpenPBR Viewer by Jamie Portsmouth, which places a strong emphasis on physical accuracy in rendering, and uses the Standard Shader Ball for consistency with offline renders.

jstone-lucasfilm avatar Apr 02 '24 04:04 jstone-lucasfilm

this is a great idea. The path-traced rendering using Three.js is astoundingly good.

It would even be used as a Render farm ?

gedw99 avatar Apr 04 '24 13:04 gedw99

Maybe a first attempt to use the ThreeJS renderer is to take Jamie's code and encapsulate it into an appropriate Javascript shader like this one

I didn't see any examples with pattern graphs but maybe a custom code generator which produces such shaders would worth investigating ? In any case trying this could help drive changes in the code gen framework to produce code / functions suitable for a path-tracer.

kwokcb avatar Apr 05 '24 15:04 kwokcb

This is a very good idea and would like to provide help on it. I have a question regarding shader compilation time and performance.

Wouldn't be WebGPU more suited for creating a path tracer ? I recon it could lead to a substantial development, but for example the openPBR viewer is truly impressive but take a long time to compile and is performance heavy for my side (RTX 2070 + Ryzen 5 3600 6-Core + 16 Go ram).

In any case, I will try to put @kwokcb idea to the test by encapsulating OpenPBR viewer shaders into a Jamie's code.

Cewein avatar May 25 '24 09:05 Cewein