2014-01-04 19:08:00 -05:00
|
|
|
#version 130
|
2013-11-30 16:33:06 -05:00
|
|
|
uniform sampler2D tex;
|
|
|
|
uniform float low;
|
|
|
|
|
2014-01-12 16:07:14 -05:00
|
|
|
in vec2 uv;
|
|
|
|
|
2013-11-30 16:33:06 -05:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 weights = vec3(0.2126, 0.7152, 0.0722); // ITU-R BT. 709
|
2014-01-19 12:53:35 -05:00
|
|
|
vec3 col = texture(tex, uv).xyz;
|
2013-11-30 16:33:06 -05:00
|
|
|
float luma = dot(weights, col);
|
|
|
|
|
|
|
|
col *= smoothstep(low, 0.9, luma);
|
|
|
|
|
|
|
|
gl_FragColor = vec4(col, 1.0);
|
|
|
|
}
|