1#version 140 2in vec2 tex_coord; 3 4void main (void) 5{ 6 vec4 white = vec4(1.0); 7 vec4 black = vec4(0.2); 8 vec4 color = white; 9 10 // First, cut out our circle 11 float x = tex_coord.x*2.0 - 1.0; 12 float y = tex_coord.y*2.0 - 1.0; 13 14 float radius = sqrt(x*x + y*y); 15 if (radius > 1.0) { 16 if (radius > 1.1) { 17 ++color; 18 } 19 20 gl_FragColor = color; 21 22 if (radius > 1.2) { 23 ++color; 24 } 25 26 discard; 27 } 28 29 // If we're near an edge, darken us a tiny bit 30 if (radius >= 0.75) 31 color -= abs(pow(radius, 16.0)/2.0); 32 33 gl_FragColor = color; 34 35} 36