reflectView
Provides a reflection vector in view space (camera space), serving as a fundamental building block for classic lighting models (like Phong specular) and certain special effects.
Core Advantages
Directly outputs a view-space reflection vector, perfectly suiting the calculation needs of traditional lighting models and offering a flexible intermediate step for advanced users creating custom shader effects.
Common Uses
Implementing classic Phong specular highlights.
Creating non-photorealistic rendering (NPR) MatCap effects.
Serving as an internal calculation base for more advanced nodes (like reflectVector).
How to adjust
This node is not directly adjustable; its output is determined by the surface normal. By assigning a normal map to the material's `normalNode`, effects like specular highlights can follow the surface details, simulating bumpy or uneven materials.
Code Examples
1// Calculate the dot product of the reflection vector and the view direction
2const specularFactor = TSL.dot( TSL.reflectView, TSL.positionViewDirection ).max( 0.0 );
3
4// Control the size and intensity of the highlight with a power operation
5const specularPower = specularFactor.pow( shininess );