[Bf-blender-cvs] [5a8629c] master: Different drawing for object centers.

Antony Riakiotakis noreply at git.blender.org
Mon May 4 13:53:31 CEST 2015


Commit: 5a8629c0d7da6cfb4b696f1787111c9492e03aba
Author: Antony Riakiotakis
Date:   Mon May 4 13:53:07 2015 +0200
Branches: master
https://developer.blender.org/rB5a8629c0d7da6cfb4b696f1787111c9492e03aba

Different drawing for object centers.

Code here did depth test always and depth range 0.0.

There is no real reason for object centers to write and get tested
against depth buffer in this case, just disable the depth test instead
;)

Helps with blurry object centers in depth of field mode too (centers
wrote depth 0 and were always blurry)

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

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 5b2ac50..de2b5a3 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -735,11 +735,7 @@ 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];
 
-	/* 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);
+	if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
 	glEnable(GL_BLEND);
 	
 	if (special_color) {
@@ -769,10 +765,9 @@ 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) glDepthFunc(GL_LEQUAL);
+	if (v3d->zbuf) glEnable(GL_DEPTH_TEST);
 }
 
 /* *********** text drawing for object/particles/armature ************* */




More information about the Bf-blender-cvs mailing list