aboutsummaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
Diffstat (limited to 'shaders')
-rw-r--r--shaders/circleMask.glsl10
1 files changed, 10 insertions, 0 deletions
diff --git a/shaders/circleMask.glsl b/shaders/circleMask.glsl
new file mode 100644
index 0000000..7595ea9
--- /dev/null
+++ b/shaders/circleMask.glsl
@@ -0,0 +1,10 @@
+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);
+}