From 9ebc3e3f5cf4847239d04cf5b3b01d0b1855a039 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 7 May 2018 06:34:22 +0200 Subject: Continue text edit, add avatar (image, but not way to change avatar) --- shaders/circleMask.glsl | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 shaders/circleMask.glsl (limited to 'shaders') 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); +} -- cgit v1.2.3