Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-02-15 04:57:26 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-02-15 14:28:26 +0300
commitcd472bc7de84e59d71bc877a94c9725d40d48c3a (patch)
tree85d76cfd6b0b9e79ce06efd75f4616204eb98a24 /source/blender/draw
parent021f8d56d070d8e3acc89c2c18cedc46ee40659d (diff)
Clay Engine: Fix Grid depth write.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/draw_view.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c
index 9846bd1b0ae..ef01a51c193 100644
--- a/source/blender/draw/intern/draw_view.c
+++ b/source/blender/draw/intern/draw_view.c
@@ -333,7 +333,7 @@ drawgrid_cleanup:
#undef GRID_MIN_PX_D
#undef GRID_MIN_PX_F
-static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool write_depth)
+static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
{
/* draw only if there is something to draw */
if (v3d->gridflag & (V3D_SHOW_FLOOR | V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_Z)) {
@@ -358,9 +358,6 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
UI_GetThemeColor3ubv(TH_GRID, col_grid);
- if (!write_depth)
- glDepthMask(GL_FALSE);
-
if (show_floor) {
const unsigned vertex_ct = 2 * (gridlines * 4 + 2);
const int sublines = v3d->gridsubdiv;
@@ -486,9 +483,6 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit, bool wr
immEnd();
immUnbindProgram();
}
-
- if (!write_depth)
- glDepthMask(GL_TRUE);
}
}
@@ -527,7 +521,7 @@ void DRW_draw_grid(void)
rv3d->gridview = ED_view3d_grid_scale(scene, v3d, &grid_unit);
glEnable(GL_DEPTH_TEST);
- glDepthMask(GL_FALSE); /* read & test depth, but don't alter it. TODO: separate UI depth buffer */
+ glDepthMask(GL_TRUE);
if (!draw_floor) {
ED_region_pixelspace(ar);
@@ -540,10 +534,8 @@ void DRW_draw_grid(void)
glLoadMatrixf((float *)rv3d->viewmat);
}
else {
- drawfloor(scene, v3d, &grid_unit, false);
+ drawfloor(scene, v3d, &grid_unit);
}
-
- glDisable(GL_DEPTH_TEST);
}
/* ************************* Background ************************** */