AcademySoftwareFoundation / OpenPBR

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

Suggest Hoffman approximations for Fresnel factor of metal under coat/film #225

Open portsmouth opened 2 months ago

portsmouth commented 2 months ago

When metal is coated by a dielectric (or a thin film), its Fresnel factor will be modified due to the adjacent dielectric IOR differing from air.

Modeling this in OpenPBR is currently not clearly stated since our metal lobe uses the "F82-tint" model, which is based on the Schlick approximation, where don't know the underlying IOR and absorption of the metal (needed to compute the Fresnel factor correctly).

So we currently just suggest to use the Gulbrandsen approach to calculate this (we mention this only in the thin-film section, but I'd also suggest we move this to the Metal section, as it applies in the case of a coated metal also):

In the case of the metallic base the physics is somewhat ambiguous since, as described in the Metal section, the Fresnel factor for metal is defined according to the Schlick-based “F82-tint” parametrization which does not specify the underlying physical complex IOR. We suggest here that some reasonable approximation is employed to map the Fresnel factor to the best matching effective complex IOR, for example that described by [Gulbrandsen2014].

However, Naty Hoffman (@natyh) (who developed the F82-tint model) has suggested some approximations to compute the modified Fresnel of metal under dielectric, within the F82-tint model. As he noted, this could be just as (or more) accurate than working with the true Fresnel equations, in the context of an RGB renderer.

His formulas are given in his talk at the SIGGRAPH 2020 course "Physically Based Shading in Theory and Practice":

https://blog.selfshadow.com/publications/s2020-shading-course/hoffman/s2020_pbs_hoffman_slides.pdf

His first suggestion is to just use the IORs alone (inferred from the F0) to do the calculation, which he shows works reasonably well:

image

His more accurate suggestion is the following formula (which isn't derived, so we should ask where this comes from):

image