Support vertical layering of opaque BSDFs - #3022
Open
jstone-lucasfilm wants to merge 4 commits into
Open
Conversation
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
requested review from
anderslanglands,
dbsmythe and
niklasharrysson
August 2, 2026 01:50
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_bsdfandsheen_bsdftransmit all of the energy they do not reflect, while opaque BSDFs such asoren_nayar_diffuse_bsdfandconductor_bsdftreat 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
layernode 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:
1 - weight.weighted_layercomposition.mix,layer,add, andmultiplynodes, and the energy conservation invariant relating transmittance to directional albedo.Notes for reviewers:
layertops inlibraries/bxdfare 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.multiplynodes intentionally preserve transmittance (attenuating only the scattered response), somultiply-scaled opaque top layers (e.g. thetopMixofLamaLayer) still fully occlude their base, whilemix-scaled top layers interpolate transmittance instead.layerclosure semantics are implemented by host renderers; the new specification section defines the expected behavior for those implementations.