diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-15 22:48:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-15 23:23:51 +0300 |
commit | dd6fcd2f21090971f0298f95c2c0d51d7a85608a (patch) | |
tree | 27cd70562b41de5050f1b52a14eb127c4e28b6c6 /source | |
parent | 728816dbdc1a6e3c094b1bbfddab4f1af5bb955a (diff) |
DRW: Fix culling algorithm for cascade shadow maps.
draw_frustum_boundbox_calc does not work properly it seems in this case.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index e69a1026815..c7ec905bc56 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -492,7 +492,14 @@ static void draw_clipping_setup_from_view(void) /* Extract Clipping Planes */ BoundBox bbox; +#if 0 /* does not currently work for all casses. */ draw_frustum_boundbox_calc(projmat, viewinv, &bbox); +#else + BKE_boundbox_init_from_minmax(&bbox, (const float[3]){-1.0f, -1.0f, -1.0f}, (const float[3]){1.0f, 1.0f, 1.0f}); + for (int i = 0; i < 8; i++) { + mul_project_m4_v3(DST.view_data.matstate.mat[DRW_MAT_PERSINV], bbox.vec[i]); + } +#endif /* Compute clip planes using the world space frustum corners. */ for (int p = 0; p < 6; p++) { |