mx_transform_uv
mx_transform_uv
Applies a 2D scale and offset transformation to UV coordinates, serving as a fundamental node for texture tiling, shifting, and atlas selection.
Core Advantages
Encapsulates the common UV transformation (`uv * scale + offset`) into a standard node, allowing for programmatic control over texture mapping in the shader, which greatly enhances material flexibility and reusability.
Common Uses
Texture Tiling
Texture Atlas Selection
Creating Dynamic Scrolling Textures
How to adjust
Adjust the `uv_scale` parameter to control tiling density; for example, `vec2(5, 1)` will tile 5 times horizontally. Adjust the `uv_offset` parameter to shift the texture's position. Connect `uv_offset` to a `timer` node to create continuous scrolling animations.
Code Examples
1// Create a 3x3 tiling effect
2const transformedUV = mx_transform_uv( vec2( 3, 3 ) );
3const tiledColor = texture( myTexture, transformedUV );