Build GLSL shaders with natural language

Favorites

    History

      Explore

      • organic motion background
      • a kaledioscope effect with trippy patterns and colors
      • dreamscape with chromatic abberation effect where mouse is
      • dreamscape
      • isometric vector art grid
      • sun
      • smoke mist turbulent
      • a smooth rainbow gradient with colors gently flowing into eachother
      • soft rainbow gradients flowing into eachother gently
      • morphing madness
      • gentle rainbow gradient
      • swirling
      • displacement shader on image with distortion centered around the mouse. add chromatic aberration effect which grows stronger at the edges
      Explore more
      precision mediump float;
      
      uniform float u_time;
      uniform vec2 u_mouse;
      uniform vec2 u_resolution;
      varying vec2 v_uv;
      
      mat2 rotate2d(float angle) {
          float s = sin(angle);
          float c = cos(angle);
          return mat2(c, -s, s, c);
      }
      
      vec2 hash22(vec2 p) {
          vec3 p3 = fract(vec3(p.xyx) * vec3(.1031, .1030, .0973));
          p3 += dot(p3, p3.yzx+33.33);
          return fract((p3.xx+p3.yz)*p3.zy);
      }
      
      float gridPattern(vec2 p) {
          vec2 i = floor(p);
          vec2 f = fract(p);
          
          vec2 h = hash22(i);
          float mouseInfluence = length(u_mouse - v_uv) * 2.0;
          
          p = rotate2d(u_time * 0.2) * p;
          
          vec2 grid = abs(fract(p - 0.5) - 0.5) / fwidth(p);
          float line = min(grid.x, grid.y);
          
          return smoothstep(1.5 + mouseInfluence, 0.5, line);
      }
      
      void main() {
          vec2 uv = v_uv;
          vec2 aspect = vec2(u_resolution.x/u_resolution.y, 1.0);
          uv *= aspect;
          
          vec2 p = uv;
          p = (p - 0.5) * 10.0;
          
          p.x -= p.y * 0.577350269;
          p.y *= 1.15470053838;
          
          float pattern = gridPattern(p);
          
          vec3 color1 = vec3(0.1, 0.4, 0.6);
          vec3 color2 = vec3(0.2, 0.9, 1.0);
          vec3 bgColor = vec3(0., 0.12, 0.15);
          
          vec3 finalColor = mix(bgColor, mix(color1, color2, pattern), pattern);
          
          float vignette = 1.0 - length(v_uv - 0.5) * 1.2;
          finalColor *= vignette;
          
          gl_FragColor = vec4(finalColor, 1.0);
          
          #include <colorspace_fragment>
      }