Skip to content

Support vertical layering of opaque BSDFs - #3022

Open
jstone-lucasfilm wants to merge 4 commits into
AcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_opaque_bsdfs
Open

Support vertical layering of opaque BSDFs#3022
jstone-lucasfilm wants to merge 4 commits into
AcademySoftwareFoundation:mainfrom
jstone-lucasfilm:dev_opaque_bsdfs

Conversation

@jstone-lucasfilm

Copy link
Copy Markdown
Member

This changelist extends vertical layering to opaque BSDFs, adopting the convention that every BSDF in the PBS library defines a vertical-layering transmittance: the fraction of incident light that passes through the BSDF to the layers beneath it. Interface BSDFs such as dielectric_bsdf and sheen_bsdf transmit all of the energy they do not reflect, while opaque BSDFs such as oren_nayar_diffuse_bsdf and conductor_bsdf treat their weight input as a statistical coverage of the surface, transmitting light only through the uncovered fraction.

Previously, an opaque BSDF used as the top input of a layer node fully occluded its base regardless of weight, so even a zero-weight lobe occluded the layers beneath it. With this change, layering an opaque BSDF over a base is equivalent to mixing the two BSDFs by the coverage, making a zero-weight lobe transparent to its base and preserving energy conservation throughout.

Specific changes:

  • Update the throughput of the opaque BSDF closures in hardware shading languages from full occlusion to the uncovered fraction 1 - weight.
  • Extend MDL shader generation to support vertical layering of opaque BSDFs, passing the layer base into their existing weighted_layer composition.
  • Add a Vertical-Layering Transmittance section to the PBR specification, defining the transmittance of each BSDF in the PBS library, its composition by the mix, layer, add, and multiply nodes, and the energy conservation invariant relating transmittance to directional albedo.
  • Add test graphs validating that layering an opaque BSDF over a base matches the equivalent mix (pixel-identical in GLSL), and that a zero-weight opaque top leaves its base unoccluded.

Notes for reviewers:

  • No shading models in the standard libraries change appearance: all layer tops in libraries/bxdf are interface BSDFs or unit-weight opaque BSDFs. User materials that layer a partial-weight opaque BSDF will brighten, as the base now correctly receives the uncovered fraction of light.
  • Shader-semantic multiply nodes intentionally preserve transmittance (attenuating only the scattered response), so multiply-scaled opaque top layers (e.g. the topMix of LamaLayer) still fully occlude their base, while mix-scaled top layers interpolate transmittance instead.
  • OSL layer closure semantics are implemented by host renderers; the new specification section defines the expected behavior for those implementations.

This changelist extends vertical layering to opaque BSDFs, adopting the convention that every BSDF in the PBS library defines a vertical-layering transmittance: the fraction of incident light that passes through the BSDF to the layers beneath it.  Interface BSDFs such as `dielectric_bsdf` and `sheen_bsdf` transmit all of the energy they do not reflect, while opaque BSDFs such as `oren_nayar_diffuse_bsdf` and `conductor_bsdf` treat their weight input as a statistical coverage of the surface, transmitting light only through the uncovered fraction.

Previously, an opaque BSDF used as the top input of a `layer` node fully occluded its base regardless of weight, so even a zero-weight lobe occluded the layers beneath it. With this change, layering an opaque BSDF over a base is equivalent to mixing the two BSDFs by the coverage, making a zero-weight lobe transparent to its base and preserving energy conservation throughout.

Specific changes:
- Update the throughput of the opaque BSDF closures in hardware shading languages from full occlusion to the uncovered fraction `1 - weight`.
- Extend MDL shader generation to support vertical layering of opaque BSDFs, passing the layer base into their existing `weighted_layer` composition.
- Add a Vertical-Layering Transmittance section to the PBR specification, defining the transmittance of each BSDF in the PBS library, its composition by the `mix`, `layer`, `add`, and `multiply` nodes, and the energy conservation invariant relating transmittance to directional albedo.
- Add test graphs validating that layering an opaque BSDF over a base matches the equivalent mix (pixel-identical in GLSL), and that a zero-weight opaque top leaves its base unoccluded.

Notes for reviewers:
- No shading models in the standard libraries change appearance: all `layer` tops in `libraries/bxdf` are interface BSDFs or unit-weight opaque BSDFs.  User materials that layer a partial-weight opaque BSDF will brighten, as the base now correctly receives the uncovered fraction of light.
- Shader-semantic `multiply` nodes intentionally preserve transmittance (attenuating only the scattered response), so `multiply`-scaled opaque top layers (e.g. the `topMix` of `LamaLayer`) still fully occlude their base, while `mix`-scaled top layers interpolate transmittance instead.
- OSL `layer` closure semantics are implemented by host renderers; the new specification section defines the expected behavior for those implementations.
@jstone-lucasfilm

Copy link
Copy Markdown
Member Author

In addition to the list of reviewers above, I'm CC'ing @krohmerNV and @jreichel-nvidia for their thoughts from the MDL perspective.

This changelist integrates the layer pass-through semantics proposed by @tdavidovicNV in AcademySoftwareFoundation#3017 into the vertical-layering transmittance framework, preserving the distinctions drawn there between reflection, absorption, and pass-through.

The following specific changes are included:

- Evaluate the transmittance of an interface BSDF with its physical Fresnel reflectance alone, classifying the energy removed by non-physical color inputs such as the `tint` of `dielectric_bsdf` as absorption within the interface, matching the behavior of existing implementations.
- Present the bidirectional pass-through factor of Weidlich and Wilkie as the ideal quantity underlying vertical layering, with the fixed-exitant-direction transmittance serving as its reference approximation.
- Restructure the `layer` node section into parallel "Layering over a BSDF" and "Layering over a VDF" subsections, clarifying that a VDF base represents a surface boundary bound to an interior medium, with medium entry governed by the Fresnel transmittance of the surface interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant