GPU/TextureCache: Map replacement non-255 alpha to fully transparent

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.
This commit is contained in:
Stenzek 2024-11-26 13:08:11 +10:00
parent 5fd79254bd
commit be7a20fef2
No known key found for this signature in database
1 changed files with 3 additions and 0 deletions

View File

@ -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
}
)";