#Make the tiling seamless when using fract()

4 messages · Page 1 of 1 (latest)

boreal wind
#

When I use fract(), it separates the shaders into what I want but the you can clearly see the separation between the fractals. I want to "ease" that separation out. Here is my code so far

    uniform vec3 iResolution;
    uniform float iTime;

    vec3 palette(float t, vec3 a, vec3 b, vec3 c) {
      vec3 d = vec3(2.277, 2.639, 1.636);

      return a + b * cos(6.2813 * (c * t + d));
    }

    void main() {
      vec2 uv = ((gl_FragCoord.xy * 2.0 - iResolution.xy) / iResolution.y);
      vec2 uvNorep = uv;
      uv = fract(2.0 * uv) - 0.5; 
      vec3 finalCol = vec3(0.0);

      for (float i = 0.0; i < 3.0; ++i) {
        uv = uv - i;
        float d = length(uv);

        float len = length(uvNorep);

        float r2 = abs(tan(d * 10.0 + iTime) / 5.0);

        vec3 a = vec3(0.407, 0.161, 0.910);
        vec3 b = vec3(0.149, 0.412, 0.443);
        vec3 c = vec3(1.048, 1.287, 1.109);

        vec3 col = palette(len + 1.0 * iTime, a, b, c) * r2;
        finalCol += col;
      }

      gl_FragColor = vec4(finalCol, 1.0);
    }

Thanks in advance

random drift
#

fract is for fractions, not fractals tho cat_think ?

boreal wind
#

But how can you still get rid of that clear between the separations?