#version 330 core

// Post-fx node: additively combine the scene (iChannel0) with the blurred bright pass (iChannel1),
// the glow strength flaring on every beat. uBeatPulse is a beat-reactive built-in from PostProcessGraph.
in vec2 ex_Uv;
out vec4 fragColor;

uniform sampler2D iChannel0; // demo scene
uniform sampler2D iChannel1; // blurred bright areas

uniform float uBeatPulse; // 1.0 at beat onset -> ~0 before next beat
uniform float strength;   // base bloom strength
uniform float beatBoost;  // extra strength added on the beat

void main() {
	vec3 base = texture(iChannel0, ex_Uv).rgb;
	vec3 glow = texture(iChannel1, ex_Uv).rgb;
	float s = strength * (1.0 + beatBoost * uBeatPulse);
	fragColor = vec4(base + glow * s, 1.0);
}
