sampler
Converts a THREE.Texture or TextureNode into a shader-usable sampler type, serving as the prerequisite step for any texture sampling operation.
Core Advantages
Enables a declarative programming style by unifying and abstracting textures from various sources, freeing developers from manual GLSL sampler declarations and data binding, which simplifies node graph construction.
Common Uses
Basic Texture Mapping
Reusing Procedural Textures
Multi-Texture Blending and Layering
How to adjust
This node has no direct parameters to adjust; its visual output is controlled entirely by transforming the UV coordinate node supplied to its `.uv()` method. For example, multiplying the UVs by a constant (`uv().mul(4)`) creates a tiling effect. Adding a time variable to the UVs (`uv().add(vec2(timer, 0))`) creates a scrolling animation. Distorting the UVs with a noise node (`uv().add(noise)`) can produce effects like water ripples or heat haze.
Code Examples
1// Convert a texture to a sampler and sample it with the uv() node
2const colorSample = sampler( myColorTexture ).uv( uv() );