Skip to content

Commit

Permalink
[hud] Properly pre-multiply graphs and bars with alpha
Browse files Browse the repository at this point in the history
Oversight, our blend mode relies on pre-multiplied alpha.
  • Loading branch information
doitsujin committed Nov 11, 2024
1 parent 664783b commit d9d9944
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dxvk/hud/shaders/hud_chunk_frag_background.frag
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ void main() {

o_color.a *= opacity;
o_color = linear_to_output(o_color);
o_color.rgb *= o_color.a;
}
1 change: 1 addition & 0 deletions src/dxvk/hud/shaders/hud_chunk_frag_visualize.frag
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ 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;
}
1 change: 1 addition & 0 deletions src/dxvk/hud/shaders/hud_graph_frag.frag
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,5 @@ void main() {

o_color = linear_to_output(o_color);
o_color.a *= opacity;
o_color.rgb *= o_color.a;
}

0 comments on commit d9d9944

Please sign in to comment.