Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Last active September 12, 2019 23:40
Show Gist options
  • Select an option

  • Save sortofsleepy/f936ac1fba253742f0010615ee2bd2af to your computer and use it in GitHub Desktop.

Select an option

Save sortofsleepy/f936ac1fba253742f0010615ee2bd2af to your computer and use it in GitHub Desktop.
vec2 uv = gl_FragCoord.xy;
//uv = fragCoord.xy / iResolution.xy;
uv.y -= u_RenderSize.y / 2.0;
uv.x -= u_RenderSize.x / 2.0;
vec2 coords = uv;
vec4 color = vec4(1.0,1.0,0.0,1.0);
float radius = 20.0;
vec2 center = vec2(0.);
float sD = distance(coords, center);
float a = 1.0 - clamp(sD - radius + .5, 0.0, 1.0);
gl_FragColor = mix(gl_FragColor,color,a * color.a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment