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;
      
      float random(vec2 st) {
          return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
      }
      
      vec2 rotate2D(vec2 p, float angle) {
          float s = sin(angle);
          float c = cos(angle);
          return vec2(p.x * c - p.y * s, p.x * s + p.y * c);
      }
      
      float lines(vec2 pos, float b) {
          float scale = 10.0;
          pos *= scale;
          return smoothstep(0.0, 0.5 + b * 0.5, abs((sin(pos.x * 3.1415) + b * 2.0)));
      }
      
      void main() {
          vec2 st = v_uv;
          st.x *= u_resolution.x/u_resolution.y;
          
          vec2 mousePos = u_mouse - vec2(0.5);
          float dist = length(st - vec2(st.x * u_resolution.x/u_resolution.y, st.y) - mousePos);
          
          vec3 color = vec3(0.0);
          
          st = rotate2D(st, u_time * 0.2 + dist * 2.0);
          
          float pattern = lines(st, 0.5);
          
          vec3 color1 = vec3(0.9, 0.5, 0.9);
          vec3 color2 = vec3(0.3, 0, 0.4);
          
          color = mix(color1, color2, pattern + dist * 2.0);
          
          float noise = random(st + u_time * 0.1) * 0.02;
          color += noise;
          
          float vignette = 1.0 - length(v_uv - 0.5) * 1.2;
          color *= vignette;
          
          gl_FragColor = vec4(color, 1.0);
          
          #include <colorspace_fragment>
      }