Texture repetition & Drawing lines issue with GLSL shaders

The issue is caused by sliding UVs. This confuses texture mipmap sampling along the line of sliding. Generally, it is a loose-loose situation.

One option is to pack several tiles in one tile (see the image) and apply it without sliding. This will make it harder to randomize tiles:

Another option is to draw in the fragment shader a thin line on the border of the grout. Here is a demo (the marked text draws the lines):

  float eps = 0.005;
  vec2 f = fract(rotatedUv);
  if( (layoutType == 2) && ((f.x<eps) || (f.x>1.0-eps))  )
  {
    gl_FragColor = vec4(1,0,0,1);
    return;
  }
  if( (layoutType == 1) && ((f.y<eps) || (f.y>1.0-eps))  )
  {
    gl_FragColor = vec4(1,0,0,1);
    return;
  }