move UVs of a texture

Hello,

How can I move the UVs of a texture. I want to use a parameter for the x-coordinates as well
as the y-coordinates.

thx

22e66718483bccc8e22637752e68107f8a7526d3.jpeg

This is what I do. Go to the material options on the left, and use a Custom UV. Create a vector parameter, use it to scale and offset your texture coordinate, and feed it back into the custom UV slot for that texture coordinate.

You *could *also do this right before sampling your texture in the main body of your material, but that will add an extra instruction in your base pass shader (for *every *pixel) compared to using a Custom UV. Using a Custom UV can also let the GPU pre-fetch the texture data since it knows at the vertex exactly which texture samples you are going to need later in the shader–probably more important for mobile devices than modern PC GPUs these days.

If you want to do fancier distortion effects (i.e. heat waves, water ripples, etc.) above and beyond a constant scale/offset, there is no way around doing it per-pixel before you sample it in the base pass.

1 Like

Thanks a lot!