#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; layout(location = U_LOC_WINDOW) uniform ivec2 window; const vec4 color_a = vec4(0.15, 0.50, 0.90, 1.0); const vec4 color_b = vec4(0.90, 1.00, 0.90, 1.0); void main() { vec2 uv = gl_FragCoord.xy / window.xy; float val = texture(buf, uv)[0]; color = mix(color_a, color_b, val); // map b/w colors to gradient }