[Bf-blender-cvs] [82d069c] blender2.8: Viewport: draw floor routine should not use GL_ALWAYS for depth

Dalai Felinto noreply at git.blender.org
Fri Oct 7 03:48:03 CEST 2016


Commit: 82d069c2327f4442f28be24d0f6ef6e6a2526366
Author: Dalai Felinto
Date:   Thu Oct 6 22:21:12 2016 +0000
Branches: blender2.8
https://developer.blender.org/rB82d069c2327f4442f28be24d0f6ef6e6a2526366

Viewport: draw floor routine should not use GL_ALWAYS for depth

(talked with merwin about that, and he agrees on it, we are not supposed to write to the scene depth buffer
but we should read its depth)

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

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 1086045..fe6dae0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -609,8 +609,6 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
 
 			immBindBuiltinProgram(GPU_SHADER_3D_FLAT_COLOR);
 
-			glDepthFunc(GL_ALWAYS); /* draw lines in order given */
-
 			immBegin(GL_LINES, vertex_ct);
 
 			/* draw normal grid lines */
@@ -687,8 +685,6 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
 			immUnbindProgram();
 
 			/* done with XY plane */
-
-			glDepthFunc(GL_LESS); /* restore default */
 		}
 
 		if (show_axis_x || show_axis_y || show_axis_z) {




More information about the Bf-blender-cvs mailing list