tangentWorld
tangentWorld
Provides the tangent direction of a model's surface in world space, used for interactions with global lighting and scene effects.
Core Advantages
Unifies the tangent into the world coordinate system, allowing direct operations with world-space elements (like directional lights, environment maps) and simplifying advanced rendering implementations.
Common Uses
Anisotropic material interaction with directional lights
Anisotropic environment reflections
Procedural effects based on world direction (e.g., snow)
How to adjust
This node's value is determined by the object's world transform (rotation, position). Adjust its effect by rotating the object in the animation loop, or by modifying the geometry's `tangent` attribute in JavaScript before rendering.
Code Examples
1// Directly get the world-space tangent vector (vec3), which is already normalized
2const worldTangent = tangentWorld;
3
4// Convert the vector from the [-1, 1] range to the displayable [0, 1] color range
5const color = worldTangent.mul( 0.5 ).add( 0.5 );
6
7// Output the converted color
8return color;