AcademySoftwareFoundation / OpenPBR

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

Implementing thin-film interference in combination with F82-tint metallic Fresnel #79

Closed lukasstockner closed 4 months ago

lukasstockner commented 1 year ago

The current spec draft points out the method used for implementing thin-film interference effects. However, this paper and its reference implementation assume that the physically correct dielectric and conductive Fresnel terms are used so that the optical phase shift can be computed.

However, OpenPBR uses the F82-tint model for metals, which directly computes the reflectivity without going through computing a complex IOR and then using it in the conductive Fresnel term.

Therefore, it might be helpful to include a note in the spec on how to reconcile this and how to compute/estimate the phase shift when implementing the thin-film component.

portsmouth commented 11 months ago

We discussed this and agree that it's not ideal that the interaction between the thin film and the rest of the model is under-specified.

In Arnold the thin-film effect amounts to adding some color fringes to the Fresnel term of the base (metal or dielectric) via "Airy" theory, but this involves knowing the IOR, which as you point out for the metal we no longer define. What we do in Arnold's OpenPBR implementation (for example) is convert from the F82 model to the conductor IOR using the Gulbrandsen model. We probably do need to say something about the need for such an approximation (i.e. how to interpret the physics given the not strictly physical F82 model).

portsmouth commented 6 months ago

We need a PR to clarify the thin film behavior.

jstone-lucasfilm commented 4 months ago

Thanks for this original report, @lukasstockner, and it's now addressed in #167.