mirror of https://github.com/PCSX2/pcsx2.git
GS-ogl: Automatically adjust color compensation based on rgb value for hw blend clr3 case.
Auto adjust when any color is higher than 128 ( 1.0f) to get more accurate color results.
This commit is contained in:
parent
e8cf4822b1
commit
8c0ee33c4c
|
@ -821,9 +821,13 @@ float As = As_rgba.a;
|
|||
Color.rgb *= vec3(255.0f);
|
||||
#elif PS_CLR_HW == 3
|
||||
// Needed for Cs*Ad, Cs*Ad + Cd, Cd - Cs*Ad
|
||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value
|
||||
|
||||
Color.rgb *= (255.0f / 128.0f);
|
||||
// Multiply Color.rgb by (255/128) to compensate for wrong Ad/255 value when rgb are below 128.
|
||||
// When any color channel is higher than 128 then adjust the compensation automatically
|
||||
// to give us more accurate colors, otherwise they will be wrong.
|
||||
// The higher the value (>128) the lower the compensation will be.
|
||||
float max_color = max(max(Color.r, Color.g), Color.b);
|
||||
float color_compensate = 255.0f / max(128.0f, max_color);
|
||||
Color.rgb *= vec3(color_compensate);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue