Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearcoat isn't energy conservative #4459

Closed
GSterbrant opened this issue Jul 21, 2022 · 0 comments · Fixed by #4657
Closed

Clearcoat isn't energy conservative #4459

GSterbrant opened this issue Jul 21, 2022 · 0 comments · Fixed by #4657
Assignees
Labels
area: graphics Graphics related issue bug

Comments

@GSterbrant
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant