Skip to content

BumpMapNode produces inverted normals with WebGL renderer #26847

@njarraud

Description

@njarraud

Description

Code produced by BumpMapNode returns inverted normals.

Current implementation
Capture d’écran 2023-09-26 à 22 11 58

Fix with negate() removed
Capture d’écran 2023-09-26 à 22 12 36

In Blender - result is the same as with the fix
Capture d’écran 2023-09-26 à 22 17 12

Reproduction steps

  1. Create a mesh using MeshPhysicalNodeMaterial
  2. Plug a BumpMapNode with a texture to normalNode input.
  3. The normals seems to be inverted

Code

The issue comes from surf_pos: positionView.negate() which shall be only surf_pos: positionView.

return perturbNormalArb({
    surf_pos: positionView.negate(),
    surf_norm: normalView,
    dHdxy,
});

Live example

None

Screenshots

No response

Version

r156

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions