Viewport: fix depth filled before solid plates

This commit is contained in:
Dalai Felinto
2016-10-24 12:58:23 +00:00
parent 6388d0c4a0
commit a3b69c8131
2 changed files with 9 additions and 9 deletions

View File

@@ -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*/) {

View File

@@ -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);
}