Circle Shader

share link

by sufyan2 dot icon Updated: Nov 5, 2023

technology logo
technology logo

Guide Kit Guide Kit  


void mainImage( out vec4 fragColor, in vec2 fragCoord )

{

  vec2 uv = fragCoord/iResolution.xy;

  uv -= 0.5;

  uv *= 2.0;

  uv.x *= iResolution.x / iResolution.y;

   

  float time = iTime;

  vec3 color = vec3(0.1, cos(iTime), sin(iTime));

   

  float d = length(uv);

  d -= 0.5;

  d = abs(d);

  d = smoothstep(0.0,0.1,d);

  fragColor = vec4(mix(color,vec3(0.0), d),1.0);

}