Question regarding PBRRougnessMetallic node and normal map

Hi,

I’m using the PBRRougnessMetallic node with a normal map. The material is applied to a plane where the surface is extruded, to make it bumpy.

Here’s a screenshot from the graph:

What I notice is that if I remove all extrusion from the plane, so that it’s completely flat. Then don’t see the lighting being affected by the normal map. So, I guess I’m not using the normal map correctly.

Ideally, I want the lighting to only be calculated based on the normal map and the orientation of the plane. For the orientation, do I need a Vector 3 input block, that I update outside of the shader, or is there a node to get the orientation of the mesh? By orientation, I mean the rotation applied to the mesh, not the orientation of each individual triangle in the mesh.

Hey!! the normal map has to be wired through a perturbNormal block connected to the PBR node

1 Like

Thank you for the information!

I thought that might have been the case, but I couldn’t find an example of perturbNormal being used. However, now that I look at the docs again, I see that the first example shows it being used:
Node Material and PBR | Babylon.js Documentation (babylonjs.com)

Not sure how I missed that before.

Edit:

I created a simple example for anyone that may need it:
Babylon.js Node Material Editor (babylonjs.com)

1 Like