Skip to content

MeshPhysicalMaterial: clearcoat should not use underlying normal map #12867

@RenateOnVizoo3d

Description

@RenateOnVizoo3d

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, ...)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions