uv
uv
Provides the 2D texture coordinates (UVs) of a model, essential for texture mapping, procedural patterns, and surface effects.
Core Advantages
As the cornerstone of texture mapping, it provides a stable 2D coordinate system on the model's surface, key to achieving rich visual detail and various surface effects.
Common Uses
Providing coordinates for texture sampling
Generating procedural patterns (e.g., checkerboards, stripes)
Creating UV animations and distortion effects (e.g., water, fire)
Debugging UV layouts (visualizing as color)
How to adjust
Adjust the effect by performing math operations on the uv() node's output. For example, multiplying by a number (`uv().mul(4)`) creates texture tiling, and adding a time node (`uv().add(time)`) creates a scrolling effect.
Code Examples
1// Get the model's first set of UV coordinates
2const uvNode = TSL.uv();
3
4// Use the UV coordinates to sample a color from the texture
5const textureSampleNode = TSL.texture( myTexture, uvNode );