[Bf-blender-cvs] [a3b69c8] blender2.8: Viewport: fix depth filled before solid plates

Dalai Felinto noreply at git.blender.org
Mon Oct 24 19:36:04 CEST 2016


Commit: a3b69c8131e4e680cc8ae1c88fad90b796af20d3
Author: Dalai Felinto
Date:   Mon Oct 24 12:58:23 2016 +0000
Branches: blender2.8
https://developer.blender.org/rBa3b69c8131e4e680cc8ae1c88fad90b796af20d3

Viewport: fix depth filled before solid plates

===================================================================

M	source/blender/editors/space_view3d/drawobject.c
M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 4adfea1..7426b20 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -6708,10 +6708,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 			}
 		}
 
-		/* TODO Viewport: draw only depth here, for selection */
+		/* TODO Viewport: draw only for selection */
 		if (!IS_VIEWPORT_LEGACY(v3d)) {
-			if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
-				glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
+			if ((dflag & DRAW_PICKING) == 0) {
+				if ((dt == OB_BOUNDBOX) || ELEM(ob->type, OB_EMPTY, OB_LAMP, OB_CAMERA, OB_SPEAKER)) {
+					goto afterdraw;
+				}
 			}
 		}
 
@@ -6842,10 +6844,8 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
 				}
 		}
 
-		/* TODO Viewport: some eleemnts are being drawn for depth only */
-		if (!IS_VIEWPORT_LEGACY(v3d)) {
-			glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-		}
+		/* TODO Viewport: some elements are being drawn for object selection only */
+afterdraw:
 
 		if (!render_override) {
 			if (ob->soft /*&& dflag & OB_SBMOTION*/) {
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 9413159..44382b0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1583,7 +1583,7 @@ static void view3d_draw_non_meshes(const bContext *C, ARegion *ar)
 	unsigned char ob_wire_col[4];            /* dont initialize this */
 
 	glEnable(GL_DEPTH_TEST);
-	glDepthMask(GL_FALSE);  /* disable write in zbuffer */
+	glDepthMask(GL_TRUE);
 	/* TODO Viewport
 	 * we are already temporarily writing to zbuffer in draw_object()
 	 * for now let's avoid writing again to zbuffer to prevent glitches
@@ -1598,7 +1598,7 @@ static void view3d_draw_non_meshes(const bContext *C, ARegion *ar)
 		}
 	}
 
-	glDepthMask(GL_TRUE);
+	glDepthMask(GL_FALSE);
 	glDisable(GL_DEPTH_TEST);
 }




More information about the Bf-blender-cvs mailing list