summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
Diffstat (limited to 'res')
-rw-r--r--res/spotlight.frag17
1 files changed, 17 insertions, 0 deletions
diff --git a/res/spotlight.frag b/res/spotlight.frag
new file mode 100644
index 0000000..91e4d0b
--- /dev/null
+++ b/res/spotlight.frag
@@ -0,0 +1,17 @@
1#version 330 core
2
3in vec2 fragTexCoord; // from raylib
4
5uniform sampler2D texture0; // from raylib
6uniform vec2 target;
7uniform float dimness;
8uniform float radius;
9
10out vec4 color;
11
12void main()
13{
14 color = mix (texture (texture0, fragTexCoord), vec4(0),
15 length (target - gl_FragCoord.xy) < radius
16 ? 0.0 : dimness);
17}