Add iridescence support to PrincipledMaterial
Iridescence is the shifting color of a soap bubble, an oil slick or a
beetle shell, where light reflected off the front and back of a thin
film interferes depending on the film thickness and the viewing angle.
The thin-film model is the one of the glTF KHR_materials_iridescence
extension, using the spectral integration of Belcour and Barla.
It is controlled by iridescenceFactor, iridescenceMap,
iridescenceIndexOfRefraction, iridescenceThicknessMinimum,
iridescenceThicknessMaximum and iridescenceThicknessMap, with a channel
property for each map. Thickness is in nanometers, and the index of
refraction is named to match the existing indexOfRefraction property.
A factor of zero, the default, leaves the generated shader unchanged
for existing materials. CustomMaterial can drive the effect through the
new IRIDESCENCE_FACTOR, IRIDESCENCE_IOR and IRIDESCENCE_THICKNESS
keywords, which take a final thickness rather than a range.
Like anisotropy this is not an additional lobe. It replaces the Fresnel
response of the specular lobe by substituting the material's F0 once
per fragment, which reaches every specular path without changing any
signatures. The trade-off is that the specular BRDF applies its own
Schlick ramp on top, slightly desaturating the tint at middling angles,
as in the glTF Sample Renderer and Filament.
[ChangeLog][PrincipledMaterial] Added the iridescenceFactor,
iridescenceMap, iridescenceChannel, iridescenceIndexOfRefraction,
iridescenceThicknessMinimum, iridescenceThicknessMaximum,
iridescenceThicknessMap and iridescenceThicknessChannel properties,
which add a thin film over the material that produces shifting colors.
Task-number: QTBUG-148681
Change-Id: I21d38a2444be7f48044f63a4100017dd4d861c73
Reviewed-by: Christian Strømme <christian.stromme@qt.io>