aboutsummaryrefslogtreecommitdiff
path: root/shaders
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-07 06:34:22 +0200
committerdec05eba <dec05eba@protonmail.com>2018-05-07 06:34:24 +0200
commit9ebc3e3f5cf4847239d04cf5b3b01d0b1855a039 (patch)
tree7a421d42e8945a1718b9c54f474acbb2d2478c28 /shaders
parent7a2cb2c4b81a8a0696d3a11ce8781542f181bb12 (diff)
Continue text edit, add avatar (image, but not way to change avatar)
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);
+}