summaryrefslogtreecommitdiff
path: root/res/spotlight.frag
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 03:47:31 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-02-11 03:47:31 +0000
commit4a355deb54b48eee5432ee617d6d3916121b0816 (patch)
tree84678b21428af2089e359bc95b28ebc8a7fe19f6 /res/spotlight.frag
parentadd .gitignore (diff)
downloadspotlight-4a355deb54b48eee5432ee617d6d3916121b0816.tar.gz
add sources
Diffstat (limited to 'res/spotlight.frag')
-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}