John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 1 | #version 140
|
| 2 | in vec2 tex_coord;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 3 |
|
| 4 | void 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 | }
|
| 27 |
|
| 28 | discard;
|
| 29 |
|
| 30 | // If we're near an edge, darken us a tiny bit
|
| 31 | if (radius >= 0.75)
|
| 32 | color -= abs(pow(radius, 16.0)/2.0);
|
| 33 |
|
| 34 | gl_FragColor = color;
|
| 35 |
|
| 36 | }
|