I have recognized that the PhyscialMaterialShader is taking the perturbed normal of the material into consideration.
Seeing how the effect is implemented elsewhere (e.g. in Blender using the Principled BSDF shader node), I would expect the clearcoat to behave like a “flat additional coating” on top of the material and not being perturbed by the underlying normal map. Thus as a change request, I would suggest to conserve the “original” normal which should be fed into the calculation of the clearcoat reflection.
In order to achieve this getLightProbeIndirectRadiance
needs to distinguish between specular and clearcoat reflection mapping; see Pseudocode:
vec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {
vec3 reflectVec;
if ( specular_reflections ) {
reflectVec = reflect( -geometry.viewDir, geometry.normal );
}
else { // clearcoat reflections
reflectVec = reflect( -geometry.viewDir, geometry.clearCoatNormal );
}
[...]
}
Alternativley passing the respective normals via the the function parameters (or adding the .originalNormal to the GeometricContext structure) could help too,
Cheers,
Renate
img attachment: glossy leather with clearcoat on top
Three.js version
- Dev
- r88
- …
Browser
- All of them
- Chrome
- Firefox
- Internet Explorer
OS
- All of them
- Windows
- macOS
- Linux
- Android
- iOS
Can you hack a live example as a proof of concept?
@WestLangley
How about we start by just making sure the clearCoat layer doesn’t have the geometry.normal perturbed? We can add parametrization later.