diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-03-07 21:03:01 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-03-08 02:09:04 +0300 |
commit | 45ec962f68f834bb662e4e25e770f8aa61891e6b (patch) | |
tree | 5b309705e96d0b6653c0f6ca2b7b0c527e76e8cb | |
parent | 8d8f7e52c1dbf7e7c56eb212ff9e934131fdaf83 (diff) |
DRW: Fix culling with inverted view (planar reflections)
Just invert the frustum planes in this case.
-rw-r--r-- | source/blender/draw/intern/draw_manager_exec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index a984a0b782f..3865bd60817 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -414,6 +414,9 @@ static void draw_clipping_setup_from_view(void) case 4: q=0; r=3; break; default: q=4; r=7; break; } + if (DST.frontface == GL_CW) { + SWAP(int, q, r); + } normal_tri_v3(DST.clipping.frustum_planes[p], bbox.vec[p], bbox.vec[q], bbox.vec[r]); DST.clipping.frustum_planes[p][3] = -dot_v3v3(DST.clipping.frustum_planes[p], bbox.vec[p]); |