MeshNormalNodeMaterial
A node material that maps the object's view-space normal vectors to RGB colors. [1] It is not affected by lights, and its color directly reflects the orientation of the geometry's surfaces, making it a very useful debugging tool. [2, 9] It is the node-based version of MeshNormalMaterial.
Core Advantages
Extremely useful for debugging and verifying the normals of a 3D model, allowing for quick identification of issues like flipped or incorrectly calculated normals. [9] Since it involves no lighting calculations, it is very performant and provides a clear, color-coded representation of the surface orientation. [3, 9]
Common Uses
Debugging 3D models to check for flipped or incorrect normals [9]
Visualizing the curvature and surface orientation of a mesh [2]
Quickly previewing the basic form of a model without needing to set up lights [9]
Creating unique psychedelic or abstract visual effects
How to adjust
This material has very few adjustment options because its color is intrinsically linked to the geometry's normals. The main way to alter its appearance is by using a `bumpMap` or `normalMap` to perturb the normals, which will in turn change the output color. [1] The `opacity` property can be used to make the material transparent. Setting `flatShading` to true will display face normals instead of smooth vertex normals. [1]
Code Examples
1<mesh>
2 <torusKnotGeometry args={[0.4, 0.15, 128, 32]} />
3 <meshNormalNodeMaterial />
4</mesh>