aboutsummaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/circle_mask.glsl9
1 files changed, 9 insertions, 0 deletions
diff --git a/shaders/circle_mask.glsl b/shaders/circle_mask.glsl
new file mode 100644
index 0000000..9f82591
--- /dev/null
+++ b/shaders/circle_mask.glsl
@@ -0,0 +1,9 @@
+uniform sampler2D texture;
+
+void main() {
+ vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
+ vec2 pixelOffset = gl_TexCoord[0].xy - vec2(0.5, 0.5);
+ float dist = sqrt(dot(pixelOffset, pixelOffset));
+ dist = smoothstep(0.47, 0.5, dist);
+ gl_FragColor = gl_Color * pixel * vec4(1.0, 1.0, 1.0, 1.0 - dist);
+}