diff options
Diffstat (limited to 'res')
| -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 | } | ||
