engine icon indicating copy to clipboard operation
engine copied to clipboard

Clearcoat isn't energy conservative

Open GSterbrant opened this issue 3 years ago • 0 comments

Description

The clearcoat shading model does not balance the energy from the base specular. As described here https://github.com/KhronosGroup/glTF/blob/main/extensions/2.0/Khronos/KHR_materials_clearcoat/README.md:

clearcoatFresnel = 0.04 + (1 - 0.04) * (1 - abs(VdotNc))^5
clearcoatAlpha = clearcoatRoughness^2

f_clearcoat = clearcoatFresnel * D(clearcoatAlpha) * G / (4 * abs(VdotNc) * abs(LdotNc))

coated_material = (f_diffuse + f_specular) * (1 - clearcoat * clearcoatFresnel) +
f_clearcoat * clearcoat

We don't apply the 1 - clearcoat * clearcoatFresnel term to balance the energy between the clearcoat and base specular layer.

Furthermore, it looks like clearcoat isn't using specular tint, so we can simplify the Schlick fresnel function for clearcoat.

GSterbrant avatar Jul 21 '22 09:07 GSterbrant