[Bf-blender-cvs] [e10ecb6] master: Revert "Different drawing for object centers."

Antony Riakiotakis noreply at git.blender.org
Mon May 4 18:01:06 CEST 2015


Commit: e10ecb6494e99e5880a1bad296464a2475feac8e
Author: Antony Riakiotakis
Date:   Mon May 4 18:00:29 2015 +0200
Branches: master
https://developer.blender.org/rBe10ecb6494e99e5880a1bad296464a2475feac8e

Revert "Different drawing for object centers."

This reverts commit 5a8629c0d7da6cfb4b696f1787111c9492e03aba.

It does not really work that well since objects can draw in front of
selection circles now.

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

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

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

diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index de2b5a3..5b2ac50 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -735,7 +735,11 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
 	const float size = ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
 	float verts[CIRCLE_RESOL][3];
 
-	if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
+	/* using gldepthfunc guarantees that it does write z values,
+	 * but not checks for it, so centers remain visible independent order of drawing */
+	if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
+	/* write to near buffer always */
+	glDepthRange(0.0, 0.0);
 	glEnable(GL_BLEND);
 	
 	if (special_color) {
@@ -765,9 +769,10 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
 	/* finish up */
 	glDisableClientState(GL_VERTEX_ARRAY);
 
+	glDepthRange(0.0, 1.0);
 	glDisable(GL_BLEND);
 
-	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
+	if (v3d->zbuf) glDepthFunc(GL_LEQUAL);
 }
 
 /* *********** text drawing for object/particles/armature ************* */




More information about the Bf-blender-cvs mailing list