transformNormalToView
Provides a direct, reliable, and optimized method to correctly transform a model's local space normal into view space (the coordinate system originating from the camera) in a single step.
Core Advantages
Greatly simplifies the logic for view-space shading calculations, allowing developers to obtain a correct and normalized view normal without worrying about complex matrix operations. It is a core tool for implementing advanced effects like MatCap and Fresnel.
Common Uses
MatCap (Material Capture) shading
Rim Lighting and Fresnel Effect
Implementing view-space lighting models
How to adjust
This node has only one input, so adjustments are made by changing the input `normal` vector. For example, you can input a vector sampled from a normal map to add surface detail to effects like MatCap or rim lighting, or input a normal blended with a dynamic value to create flowing, non-realistic animated effects on the surface.
Code Examples
1// Directly transform the local normal to view space
2// The node handles all necessary matrix transformations internally and ensures the result is normalized
3const viewNormal = transformNormalToView( normalLocal );