use correct luminance calculation for greyscale
This commit is contained in:
parent
55c52977b3
commit
d48042a258
1 changed files with 2 additions and 4 deletions
|
@ -12,10 +12,8 @@ void main() {
|
||||||
|
|
||||||
tex.a += float(u_forceAlpha);
|
tex.a += float(u_forceAlpha);
|
||||||
|
|
||||||
if( saturation != 1.0 ) {
|
if (saturation != 1.0) {
|
||||||
vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );
|
tex.rgb = mix(vec3(dot( vec3( 0.30, 0.59, 0.11 ), tex.rgb )), tex.rgb, saturation);
|
||||||
desaturated = vec3( dot( desaturated, tex.rgb ));
|
|
||||||
tex.rgb = tex.rgb * vec3( saturation ) + desaturated * vec3( 1.0 - saturation );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tex *= modulation;
|
tex *= modulation;
|
||||||
|
|
Loading…
Reference in a new issue