Tiling / Repeat SPR
There is a much simpler way to do this effect, just activate the repetition of the image in the texture field and use this code
shader_type canvas_item;
void fragment() {
COLOR = texture(TEXTURE, vec2(UV.x * 3., UV.y * 8.));
}
LOL
Shader code
shader_type canvas_item;
uniform vec2 tiling = vec2(2.0, 1.0);
uniform vec2 offset = vec2(0.0, 0.0);
uniform bool moving = false;
void vertex() {
UV *= tiling;
UV += offset;
if (moving) {
UV += offset * TIME;
}
}
void fragment() {
vec2 newUV = fract(UV);
COLOR = texture(TEXTURE, newUV);
}