Fast Mirror Repeat Snippet
Veryvery basic code snippet, but i need this so very often I might as well post it XD
Shader code
uniform float tile_multiplier = 4.0;
//↑ move this to your top of file
vec2 mirroring(vec2 uv) {
uv = fract(uv); uv = 1.0 - abs(2.0 * uv - 1.0);
return uv;
}
//---------- move this to fragment -----------
//vec2 mirror_tiled_uv = mirroring(UV*tile_multiplier);
//--------------------------------------------


