Skip to content

Commit

Permalink
GPU/TextureCache: Map replacement non-255 alpha to fully transparent
Browse files Browse the repository at this point in the history
That way if during the scaling process you end up with interpolated
colours, the cutout alpha is preserved.

Ideally we'd blend it, but that tends to create more problems than it
solves on PSX.
  • Loading branch information
stenzek committed Nov 26, 2024
1 parent 5fd7925 commit be7a20f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/gpu_hw_shadergen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,9 @@ std::string GPU_HW_ShaderGen::GenerateReplacementMergeFragmentShader(bool semitr
#else
// Leave (0,0,0,0) as 0000 for opaque replacements for cutout alpha.
o_col0.a = color.a;
// Map anything with an alpha below 0.5 to transparent.
o_col0 = lerp(o_col0, float4(0.0, 0.0, 0.0, 0.0), float(o_col0.a < 0.5));
#endif
}
)";
Expand Down

0 comments on commit be7a20f

Please # to comment.