normalWorldGeometry
A TSL node representing the direction of the geometry vertex normal of the current rendered object in world space. It represents the unmodified, raw geometry normal.
Core Advantages
Provides the raw geometry normal in the world coordinate system, which is fundamental for implementing custom lighting, environmental effects, and surface orientation-based shading techniques, independent of view transformations.
Common Uses
Implementing custom lighting models (e.g., Phong or Blinn-Phong).
Creating rim lighting or Fresnel effects.
Calculating environmental reflections or refractions without considering normal maps.
Visualizing and debugging a model's geometry normals.
How to adjust
The output of this node depends on the model's geometry normal data and its world transform (position, rotation, scale). Additionally, the material's `flatShading` property affects whether the normal is interpolated between vertices or remains constant across the face.
Code Examples
1let normal = normalViewGeometry.transformDirection( cameraViewMatrix );
2
3if ( builder.material.flatShading !== true ) {
4
5 normal = normal.toVarying( 'v_normalWorldGeometry' );
6
7}
8
9return normal.normalize().toVar( 'normalWorldGeometry' );