Skip to content

Instantly share code, notes, and snippets.

@jbilcke
Created October 19, 2011 08:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbilcke/1297784 to your computer and use it in GitHub Desktop.
Save jbilcke/1297784 to your computer and use it in GitHub Desktop.
Anti-aliased circle in GLSL (eg. WebGL)
void main(void) {
vec2 pos = mod(gl_FragCoord.xy, vec2(50.0)) - vec2(25.0);
gl_FragColor = mix(vec4(.90, .90, .90, 1.0), vec4(.20, .20, .40, 1.0), smoothstep(380.25, 420.25, dot(pos, pos)));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment