Eevee: Fix render depth pass being negative

This commit is contained in:
Clément Foucault 2019-05-27 13:18:47 +02:00
parent 8cfd46a5b0
commit 24ac970624
Notes: blender-bot 2023-02-14 02:26:44 +01:00
Referenced by issue #65110, GPencil Eevee render always set meshes in front
1 changed files with 2 additions and 3 deletions

View File

@ -376,11 +376,10 @@ static void eevee_render_result_z(RenderLayer *rl,
else {
if (is_persp) {
rp->rect[i] = rp->rect[i] * 2.0f - 1.0f;
rp->rect[i] = viewmat[3][2] / (rp->rect[i] + viewmat[2][2]);
rp->rect[i] = -viewmat[3][2] / (rp->rect[i] + viewmat[2][2]);
}
else {
rp->rect[i] = -common_data->view_vecs[0][2] +
rp->rect[i] * -common_data->view_vecs[1][2];
rp->rect[i] = common_data->view_vecs[0][2] + rp->rect[i] * common_data->view_vecs[1][2];
}
}
}