DRW: Fix culling with inverted view (planar reflections)

Just invert the frustum planes in this case.
This commit is contained in:
2018-03-07 19:03:01 +01:00
parent 8d8f7e52c1
commit 45ec962f68

View File

@@ -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]);