Fix: EEVEE-Next: Incorrect Alpha in AOVs

Was caused by float imprecision and storage precision
conversion. Use same fix as combined pass but
more selective as the alpha channel can contain
other data for AOVs.

Fix #118494
This commit is contained in:
Clément Foucault
2024-05-07 18:39:12 +02:00
parent 00e2f55239
commit bd34a74439

View File

@@ -520,6 +520,12 @@ void film_store_color(FilmSample dst, int pass_id, vec4 color, inout vec4 displa
color = vec4(0.0, 0.0, 0.0, 1.0);
}
/* Fix alpha not accumulating to 1 because of float imprecision. But here we cannot assume that
* the alpha contains actual transparency and not user data. Only bias if very close to 1. */
if (color.a > 0.9999 && color.a < 1.0) {
color.a = 1.0;
}
if (display_id == pass_id) {
display = color;
}