1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 01:24:11 +01:00

[hud] Pre-multiply alpha before color space conversion

Derp.
This commit is contained in:
Philip Rebohle 2024-11-11 12:53:52 +01:00
parent 3756e83ae4
commit 757081a55a
3 changed files with 4 additions and 3 deletions

View File

@ -26,6 +26,6 @@ void main() {
}
o_color.a *= opacity;
o_color = linear_to_output(o_color);
o_color.rgb *= o_color.a;
o_color = linear_to_output(o_color);
}

View File

@ -63,6 +63,6 @@ void main() {
float blendFactor = 0.5f * float(bitsSet) / max(float(bitsTotal), 1.0f);
o_color = vec4(mix(color.rgb, vec3(1.0f), blendFactor), color.a * opacity);
o_color = linear_to_output(o_color);
o_color.rgb *= o_color.a;
o_color = linear_to_output(o_color);
}

View File

@ -81,7 +81,8 @@ void main() {
float diff = (diff_lo + diff_hi) + y_delta;
o_color = mix(bg_color, line_color, clamp(diff / y_delta, 0.0f, 1.0f));
o_color = linear_to_output(o_color);
o_color.a *= opacity;
o_color.rgb *= o_color.a;
o_color = linear_to_output(o_color);
}