diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-05-27 17:14:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-05-27 17:14:58 +0300 |
commit | a74041c96c71d675a8aa548dce3043438e5bd1ba (patch) | |
tree | 6506d84f6b54c75196a5e8cbd2edc6f91841390d | |
parent | 380f07d0eecc4515bf919ff8d6e8ffb81b36fa39 (diff) |
Eevee/GPencil: Fix depth reading after render
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_render.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_render.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 1283fbb3ebb..2afd0b1d313 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -365,8 +365,8 @@ static void eevee_render_result_z(RenderLayer *rl, bool is_persp = DRW_view_is_persp_get(NULL); - float viewmat[4][4]; - DRW_view_viewmat_get(NULL, viewmat, false); + float winmat[4][4]; + DRW_view_winmat_get(NULL, winmat, false); /* Convert ogl depth [0..1] to view Z [near..far] */ for (int i = 0; i < rp->rectx * rp->recty; ++i) { @@ -376,7 +376,7 @@ 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] = winmat[3][2] / (rp->rect[i] + winmat[2][2]); } else { rp->rect[i] = -common_data->view_vecs[0][2] + diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index 8f3382fc138..301c29af335 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -212,7 +212,7 @@ static void GPENCIL_render_result_z(struct RenderLayer *rl, GPENCIL_render_update_vecs(vedata); float winmat[4][4]; - DRW_view_persmat_get(stl->storage->view, winmat, false); + DRW_view_winmat_get(stl->storage->view, winmat, false); /* Convert ogl depth [0..1] to view Z [near..far] */ for (int i = 0; i < BLI_rcti_size_x(rect) * BLI_rcti_size_y(rect); i++) { |