materialNormal
Provides the final calculated surface normal vector, which has built-in logic to process both Normal Maps and Bump Maps.
Core Advantages
Its core advantage is extreme simplification and encapsulation: it fully automates all complex logic, including normal map decoding, bump map conversion, and TBN matrix calculations, allowing developers to get the final surface normal in a unified and reliable way.
Common Uses
As a fundamental input for PBR lighting models to add rich surface detail to low-poly models.
Creating distorted reflection or refraction effects (like water) by using a wave normal map.
In MatCap materials, used as sampling coordinates to look up the material color.
In toon shading, as the basis for determining the boundary between light and shadow.
How to adjust
Configure by modifying material properties in JavaScript. Set `material.normalMap` and `material.normalScale` to control the normal map effect, or set `material.bumpMap` and `material.bumpScale` for the bump map effect. Normal maps have priority over bump maps.
Code Examples
1// In a physical lighting model, materialNormal is a core input for lighting calculations
2const lighting = PBR( {
3 normal: materialNormal, // <-- Used here
4 // ... other PBR inputs
5} );