Skip to content

Instantly share code, notes, and snippets.

@ZachSaucier
Last active December 6, 2021 20:12
Show Gist options
  • Save ZachSaucier/f924f49fe8e8d8c9e5a1ae305ff6716a to your computer and use it in GitHub Desktop.
Save ZachSaucier/f924f49fe8e8d8c9e5a1ae305ff6716a to your computer and use it in GitHub Desktop.

Revisions

  1. ZachSaucier revised this gist Dec 6, 2021. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions antialiased-circle.glsl
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,3 @@
    float border = 0.01;
    vec2 m = uv - vec2(0.5, 0.5);
    float dist = 0.5*0.5 - (m.x * m.x + m.y * m.y);
    float t = mix( dist / border, 1., max(0., sign(dist - border)) );
    gl_FragColor = vec4(color, t);
    gl_FragColor = mix(color0, color1, t);
  2. ZachSaucier created this gist Dec 6, 2021.
    5 changes: 5 additions & 0 deletions antialiased-circle.glsl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    float border = 0.01;
    vec2 m = uv - vec2(0.5, 0.5);
    float dist = 0.5*0.5 - (m.x * m.x + m.y * m.y);
    float t = mix( dist / border, 1., max(0., sign(dist - border)) );
    gl_FragColor = vec4(color, t);