EEVEE: Fix unpremultiplied alpha in render result

Fix T57102
This commit is contained in:
Clément Foucault 2018-10-08 17:07:09 +02:00
parent eea22dd5ef
commit 8c4a7593f2
Notes: blender-bot 2023-02-14 05:14:03 +01:00
Referenced by issue #57102, HDRI  showing behind the objects even when world background is set to transparent
1 changed files with 6 additions and 0 deletions

View File

@ -191,6 +191,12 @@ static void eevee_render_result_combined(
rect->xmin, rect->ymin,
BLI_rcti_size_x(rect), BLI_rcti_size_y(rect),
4, 0, rp->rect);
/* Premult alpha */
int pixels_len = BLI_rcti_size_x(rect) * BLI_rcti_size_y(rect);
for (int i = 0; i < pixels_len * 4; i += 4) {
mul_v3_fl(rp->rect + i, rp->rect[i + 3]);
}
}
static void eevee_render_result_subsurface(