refractView
Provides a refraction vector in view space (camera space), serving as a foundation for custom screen-space distortion effects or for building more advanced refraction nodes.
Core Advantages
Exposes the core view-space refraction calculation, offering great flexibility for advanced custom effects like screen-space distortion, while automatically using the material's index of refraction property.
Common Uses
Creating screen-space distortion effects (e.g., lenses, heat haze).
Serving as the internal calculation basis for the `refractVector` node.
Used as a color output for visually debugging refraction directions.
How to adjust
Control the distortion intensity by modifying the `ior` (index of refraction) property of its host physical material, or add surface detail to the distortion effect by connecting a `normalNode`.
Code Examples
1// Extract the XY components as a 2D distortion vector
2const distortionVec = TSL.refractView.xy.mul( 0.1 );
3
4// Apply the distortion vector to the standard screen UV coordinates
5const distortedUVs = TSL.uv().add( distortionVec );