Define layer pass-through semantics - #3017
Open
tdavidovicNV wants to merge 1 commit into
Open
Conversation
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.
While reviewing the
layerequation added in #2964, I found that deriving base attenuation as1 - E_topconflates two different outcomes: energy absorbed by the top layer and energy passed toward the base.This is visible with a colored reflection-only dielectric. For untinted Fresnel albedo
F = 0.04and tintc = (1, 0.25, 0.05), the complete top albedo is:The current specification therefore gives base attenuation
(0.96, 0.99, 0.998). The existing GLSL and OSLtestrenderimplementations instead use the untinted unreflected share(1 - F) = (0.96, 0.96, 0.96), treating the tint-removed energy as absorption rather than returning it to the base.This PR introduces an explicit color-valued pass-through factor that may depend on both incident and outgoing directions:
This follows the two-leg construction in Weidlich and Wilkie 2007, section 3.2, where the lower-layer BRDF is attenuated by entry transmission, absorption over the incident and outgoing paths, and return transmission.
For nested layers, the pass-through factors multiply recursively. The PR also separates BSDF-over-BSDF composition from a BSDF bound to a VDF: a lossless transmissive interface has complete directional albedo near one, but that should not prevent transmitted light from entering the medium.
The current implementations are not changed:
BSDF.throughput, and multiplies it inlayer. Reflection-only dielectric and sheen keep artistic color out of pass-through, while generalized Schlick reduces its color-valued albedo to an RGB average.testrender): Also approximates pass-through using only the outgoing direction. It computes top opacity fromfilter_oand scales the base by one minus that value. Dielectric uses untinted pass-through, sheen uses a scalar estimate based on the maximum color component, and generalized Schlick uses a scalar energy estimate.