MeshPhysicalMaterial: clearcoat should not use underlying normal map

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

capture

  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

2 thoughts on “MeshPhysicalMaterial: clearcoat should not use underlying normal map

  1. @WestLangley

    It is probably sufficient to keep it simple and just to add two properties:

    material.clearCoatNormalMap
    material.clearCoatNormalScale

    If clearCoatNormalMap is null, the clear coat uses no normal map.

    How about we start by just making sure the clearCoat layer doesn’t have the geometry.normal perturbed? We can add parametrization later.

Comments are closed.