Remove gamma correction from color correction shader
Gamma correction was incorrectly skewing both color inversion and Daltonization, which resulted in washed-out colors. Bug: 20346301 Change-Id: I34d879f902c3be115b2d23f09c3ed3902799759e
This commit is contained in:
parent
d9c4971da2
commit
3acd9f1d8f
@ -199,10 +199,8 @@ String8 ProgramCache::generateFragmentShader(const Key& needs) {
|
|||||||
// un-premultiply if needed before linearization
|
// un-premultiply if needed before linearization
|
||||||
fs << "gl_FragColor.rgb = gl_FragColor.rgb/gl_FragColor.a;";
|
fs << "gl_FragColor.rgb = gl_FragColor.rgb/gl_FragColor.a;";
|
||||||
}
|
}
|
||||||
fs << "gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(2.2));";
|
|
||||||
fs << "vec4 transformed = colorMatrix * vec4(gl_FragColor.rgb, 1);";
|
fs << "vec4 transformed = colorMatrix * vec4(gl_FragColor.rgb, 1);";
|
||||||
fs << "gl_FragColor.rgb = transformed.rgb/transformed.a;";
|
fs << "gl_FragColor.rgb = transformed.rgb/transformed.a;";
|
||||||
fs << "gl_FragColor.rgb = pow(gl_FragColor.rgb, vec3(1.0 / 2.2));";
|
|
||||||
if (!needs.isOpaque() && needs.isPremultiplied()) {
|
if (!needs.isOpaque() && needs.isPremultiplied()) {
|
||||||
// and re-premultiply if needed after gamma correction
|
// and re-premultiply if needed after gamma correction
|
||||||
fs << "gl_FragColor.rgb = gl_FragColor.rgb*gl_FragColor.a;";
|
fs << "gl_FragColor.rgb = gl_FragColor.rgb*gl_FragColor.a;";
|
||||||
|
Loading…
Reference in New Issue
Block a user