refractVector
Provides a world-space refraction vector used for sampling environment maps, enabling the easy creation of physically-based refraction effects like glass, water, or crystal.
Core Advantages
Encapsulates complex physics (Snell's Law) and coordinate transforms into a single node, and automatically uses the material's `ior` (index of refraction) property, making the implementation and adjustment of refraction effects highly intuitive.
Common Uses
Creating photorealistic glass or crystal materials.
Simulating the distortion effects of dynamic water or liquid surfaces.
Implementing sci-fi energy shields or spatial distortion fields.
How to adjust
Control the amount of distortion by modifying the `ior` (index of refraction) property of its host physical material, or simulate rough surface refractions like frosted glass or rippling water by connecting a `normalNode`.
Code Examples
1// Sample the environment map with refractVector to get the distorted background
2envMapNode.uv( TSL.refractVector )