blob: 725c8548673345a3426313b105fa904af1598309 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#version 460 core
#include "consts.h"
out vec4 color;
in vec4 gl_FragCoord;
uniform float time;
uniform sampler2D buf;
ivec2 window = ivec2(RES_H, RES_V);
void main() {
vec2 point = vec2(sin(time), cos(time)) * 0.7;
point.x *= float(window.y) / float(window.x); // adjust for aspect ratio
point = ((point + 1.0) / 2.0) * window.xy; // convert to screen coords
float r = 20.0; // circle radius
color = vec4(0.0);
if (length(gl_FragCoord.xy - point) < r)
color = vec4(1.0);
color += texture(buf, gl_FragCoord.xy / window.xy) * 0.95;
}
|