texture
The fundamental node for sampling (reading) a color value from a texture at specified UV coordinates, forming the core of texturing operations in shaders.
Core Advantages
Its inputs, such as UV coordinates, are fully programmable with other nodes. This allows for advanced dynamic visual effects like UV distortion, scrolling, and procedural texturing directly within the shader.
Common Uses
Basic color mapping (Albedo)
Normal mapping for surface detail
Environment mapping for reflections (CubeTexture)
Sampling PBR data textures (e.g., roughness, metallic)
How to adjust
Primarily by programmatically manipulating the `uvNode` input. To tile a texture, multiply the UVs (e.g., `uv().mul(4)`). To create a scrolling effect, add a time-based value (e.g., `uv().add(timerLocal())`). For complex distortions like water ripples, use mathematical functions like `sin()` to dynamically offset the UV coordinates.
Code Examples
1
2// Standard texture sampling using the model's default UV coordinates
3const color = texture( myColorMap, uv() );
4
5// Create a scrolling effect by modifying UV coordinates over time
6const scrolledColor = texture( myColorMap, uv().add( timerLocal( 0.1 ) ) );