dot
Calculates the dot product of two vectors, used to measure their directional alignment.
Core Advantages
Encapsulates complex component-wise multiplication and addition into a single, high-performance node. Its core value lies in providing strong geometric intuition—directly measuring the similarity of two directions rather than performing tedious algebraic calculations.
Common Uses
Basic diffuse lighting (Lambertian)
Fresnel effect and rim lighting
Procedural directional masking (e.g., snow)
Spotlight effect
How to adjust
By changing its two input vectors (e.g., replacing a light direction vector with a view direction vector), its geometric meaning can be fundamentally altered. For instance, changing a dynamic light direction to a fixed world 'up' vector transforms the node's function from calculating lighting intensity to creating a mask for snow on top of an object.
Code Examples
1const diffuseFactor = dot( normalWorld, lightDirection ).max( 0.0 );