[Bf-blender-cvs] [80415ee2031] master: Cleanup: remove legacy OpenGL viewport clipping code
Campbell Barton
noreply at git.blender.org
Fri Feb 7 14:41:01 CET 2020
Commit: 80415ee2031f1b1b9ef38774fa9a297f7a5018aa
Author: Campbell Barton
Date: Sat Feb 8 00:38:40 2020 +1100
Branches: master
https://developer.blender.org/rB80415ee2031f1b1b9ef38774fa9a297f7a5018aa
Cleanup: remove legacy OpenGL viewport clipping code
===================================================================
M source/blender/editors/space_view3d/view3d_draw.c
===================================================================
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 6704fc9908f..d092de4fcce 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1947,45 +1947,23 @@ bool ED_view3d_clipping_test(const RegionView3D *rv3d, const float co[3], const
return view3d_clipping_test(co, is_local ? rv3d->clip_local : rv3d->clip);
}
-/* Legacy 2.7x, now use shaders that use clip distance instead.
- * Remove once clipping is working properly. */
-#define USE_CLIP_PLANES
-
-void ED_view3d_clipping_set(RegionView3D *rv3d)
+void ED_view3d_clipping_set(RegionView3D *UNUSED(rv3d))
{
-#ifdef USE_CLIP_PLANES
- double plane[4];
- const uint tot = (rv3d->viewlock & RV3D_BOXCLIP) ? 4 : 6;
-
- for (unsigned a = 0; a < tot; a++) {
- copy_v4db_v4fl(plane, rv3d->clip[a]);
- glClipPlane(GL_CLIP_PLANE0 + a, plane);
- glEnable(GL_CLIP_PLANE0 + a);
- glEnable(GL_CLIP_DISTANCE0 + a);
- }
-#else
- for (unsigned a = 0; a < 6; a++) {
+ for (uint a = 0; a < 6; a++) {
glEnable(GL_CLIP_DISTANCE0 + a);
}
-#endif
}
/* Use these to temp disable/enable clipping when 'rv3d->rflag & RV3D_CLIPPING' is set. */
void ED_view3d_clipping_disable(void)
{
- for (unsigned a = 0; a < 6; a++) {
-#ifdef USE_CLIP_PLANES
- glDisable(GL_CLIP_PLANE0 + a);
-#endif
+ for (uint a = 0; a < 6; a++) {
glDisable(GL_CLIP_DISTANCE0 + a);
}
}
void ED_view3d_clipping_enable(void)
{
- for (unsigned a = 0; a < 6; a++) {
-#ifdef USE_CLIP_PLANES
- glEnable(GL_CLIP_PLANE0 + a);
-#endif
+ for (uint a = 0; a < 6; a++) {
glEnable(GL_CLIP_DISTANCE0 + a);
}
}
More information about the Bf-blender-cvs
mailing list