cntrl/assets/shaders/bloom_bright.fs

16 lines
402 B
GLSL

#version 330
// Half-resolution bright pass for the S12 bloom chain.
in vec2 fragTexCoord;
in vec4 fragColor;
out vec4 finalColor;
uniform sampler2D texture0;
uniform float uThreshold = 0.62;
void main()
{
vec3 c = texture(texture0, fragTexCoord).rgb;
float l = dot(c, vec3(0.2126, 0.7152, 0.0722));
float k = max(l - uThreshold, 0.0) / max(l, 1e-4);
finalColor = vec4(c * k, 1.0);
}