use correct luminance calculation for greyscale

icc-effect-5.14.5
Thomas Lübking 2011-12-18 19:41:14 +01:00
parent 55c52977b3
commit d48042a258
1 changed files with 2 additions and 4 deletions

View File

@ -12,10 +12,8 @@ void main() {
tex.a += float(u_forceAlpha);
if( saturation != 1.0 ) {
vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
desaturated = vec3( dot( desaturated, tex.rgb ));
tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
if (saturation != 1.0) {
tex.rgb = mix(vec3(dot( vec3( 0.30, 0.59, 0.11 ), tex.rgb )), tex.rgb, saturation);
}
tex *= modulation;