#version 460 core #include "consts.h" layout(location = 0) out vec4 color; in vec4 gl_FragCoord; layout(location = U_LOC_TIME) uniform float time; layout(location = U_LOC_PASS1) uniform sampler2D buf; ivec2 res = ivec2(RES_H, RES_V); void main() { vec2 point = vec2(sin(time), cos(time)) * 0.7; point.x *= float(res.y) / float(res.x); // adjust for aspect ratio point = ((point + 1.0) / 2.0) * res.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 / res.xy) * 0.95; }