AcademySoftwareFoundation / OpenPBR

Specification and reference implementation for the OpenPBR Surface shading model
Apache License 2.0
439 stars 18 forks source link

MaterialX: support thin-walled dielectric #237

Open portsmouth opened 2 weeks ago

portsmouth commented 2 weeks ago

In OpenPBR's thin walled mode, we describe the behavior of the base dielectric as follows:

The translucent-base slab can be considered an infinitesimally thin sheet of dielectric (absorbing but non-scattering), with the BSDF fdielectric on both sides. A ladder of inter-reflections occurs inside this slab producing a reflected lobe and un-deflected refracted lobe. The transmission_color can be assumed to give the transmittance through the thin sheet at normal incidence (due to absorption). In the smooth case the BRDF and BTDF of this sheet can be solved exactly by summing over a geometrical series of terms containing Fresnel and absorption factors, and this can be extended to a good approximation of the rough case by appropriately roughening the transmission lobe (as described in [Kulla2017]). This model of thin-walled glass is a cheaper, much more convenient way to render windows than a finite thickness non-thin-walled mesh.

The "Revisiting Physically Based Shading at Imageworks" notes from Kulla and Conty describe their implementation of this:

image image

This is implemented natively in Arnold.

It is not currently available in MaterialX it seems. So thin-walled glass is a missing feature currently in the MaterialX implementation.

jstone-lucasfilm commented 1 week ago

Following up on this issue, here's a good overview of the status of thin-walled dielectric support in MaterialX:

https://github.com/AcademySoftwareFoundation/MaterialX/issues/864

As a quick summary, the thin_walled flag is available on surface nodes in MaterialX 1.39, but as of today it only has an MDL implementation, and not yet OSL or GLSL implementations.

Here's a related proposal to use the new thin_walled feature in the glTF PBR shading model:

https://github.com/AcademySoftwareFoundation/MaterialX/pull/1937