AcademySoftwareFoundation / OpenPBR

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

Define the glossy-diffuse albedo to explicitly correct for darkening #165

Closed portsmouth closed 3 months ago

portsmouth commented 5 months ago

Addresses issue https://github.com/AcademySoftwareFoundation/OpenPBR/issues/141.

We need to explain that, although physically the glossy-diffuse slab (as described) should exhibit darkening/saturation due to the same physics as the coat darkening (i.e. multiple bounces inside the gloss layer losing energy as they hit the colored base), we want to prevent this so that the user sees -- to the extent possible -- the base color she selected.

But she can't see the exact base color she selected, because the Fresnel of the gloss is superimposed on the diffuse base lobe. So we make the required color be a blend of the Fresnel and unsaturated base color (i.e. essentially the albedo-scaling formula). This is the same mechanism we used to define how the coat "un-darkening" works. Thus albedo-scaling automatically does the right thing (but if the implementation does something different, e.g. more physically correct, it is still well-defined what the goal albedo needs to be so the appearance won't break).

Note this won't make any difference to implementations that already use the albedo-scaling approximation (e.g. Arnold, MaterialX).

This will need to be tweaked once we get the coat darkening PR https://github.com/AcademySoftwareFoundation/OpenPBR/pull/162 in, as it should reference that discussion.

image

portsmouth commented 3 months ago

This need to be refactored slightly to match the refactored discussion of the subsurface remapping (#171), as it involves basically the same idea. Done.

portsmouth commented 3 months ago

Ready to merge.