diff options
| author | 2026-02-11 03:47:31 +0000 | |
|---|---|---|
| committer | 2026-02-11 03:47:31 +0000 | |
| commit | 4a355deb54b48eee5432ee617d6d3916121b0816 (patch) | |
| tree | 84678b21428af2089e359bc95b28ebc8a7fe19f6 /res/spotlight.frag | |
| parent | add .gitignore (diff) | |
| download | spotlight-4a355deb54b48eee5432ee617d6d3916121b0816.tar.gz | |
add sources
Diffstat (limited to 'res/spotlight.frag')
| -rw-r--r-- | res/spotlight.frag | 17 |
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 | |||
| 3 | in vec2 fragTexCoord; // from raylib | ||
| 4 | |||
| 5 | uniform sampler2D texture0; // from raylib | ||
| 6 | uniform vec2 target; | ||
| 7 | uniform float dimness; | ||
| 8 | uniform float radius; | ||
| 9 | |||
| 10 | out vec4 color; | ||
| 11 | |||
| 12 | void main() | ||
| 13 | { | ||
| 14 | color = mix (texture (texture0, fragTexCoord), vec4(0), | ||
| 15 | length (target - gl_FragCoord.xy) < radius | ||
| 16 | ? 0.0 : dimness); | ||
| 17 | } | ||
