Skip to content

Instantly share code, notes, and snippets.

@slembcke
Created December 9, 2011 02:15
Show Gist options
  • Save slembcke/1449811 to your computer and use it in GitHub Desktop.
Save slembcke/1449811 to your computer and use it in GitHub Desktop.
fwidth() AA
#extension GL_OES_standard_derivatives : enable
varying lowp vec4 frag_color;
varying lowp vec2 frag_texcoord;
void main()
{
#if GL_OES_standard_derivatives == 1
gl_FragColor = frag_color*smoothstep(0.0, length(fwidth(frag_texcoord)), 1.0 - length(frag_texcoord));
#else
gl_FragColor = frag_color;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment