Skip to content

Instantly share code, notes, and snippets.

@PsichiX
Last active November 15, 2015 22:33
Show Gist options
  • Save PsichiX/36342501a92f995b9f47 to your computer and use it in GitHub Desktop.
Save PsichiX/36342501a92f995b9f47 to your computer and use it in GitHub Desktop.
Circle-cut GLSL shader
varying vec2 vUv0;
uniform vec4 uTint;
void main(void)
{
float f = step(dot(vUv0.xy), 1.0);
gl_FragColor = vec4(uTint.rgb, uTint.a * f);
}
attribute vec2 aPosition;
attribute vec2 aUv0;
varying vec2 vUv0;
void main(void)
{
vUv0 = aUv0 * vec2(2.0) - vec2(1.0);
gl_Position = transform(aPosition);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment