normalViewGeometry
Provides the original geometric normal in view space, automatically adapting to flat or smooth shading based on the material's `flatShading` property, and is unaffected by normal maps.
Core Advantages
It cleanly separates the macroscopic geometric silhouette from microscopic surface details (like normal maps), making it a cornerstone for stable effects that rely on the object's true silhouette, such as rim lighting and toon shading.
Common Uses
Implementing Fresnel effects or rim lighting
Toon/Cel shading
Visualizing and debugging geometry normals
How to adjust
This node has no parameters itself; its behavior is controlled by the material's `flatShading` property. Setting `flatShading` to `true` outputs sharp, face-based normals, while `false` outputs smooth, vertex-interpolated normals.
Code Examples
1// Calculate the dot product of the normal and view direction
2const fresnelDot = dot( normalViewGeometry, positionViewDirection.normalize() );
3
4// Use smoothstep to create a smooth transition from the edge
5const fresnelFactor = smoothstep( 0.25, 0.1, fresnelDot );