diff options
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index e36654323fd..fa72f28cc44 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -396,6 +396,7 @@ static void draw_textured_end(void) glShadeModel(GL_FLAT); glDisable(GL_CULL_FACE); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE); /* XXX, bad patch - GPU_default_lights() calls * glLightfv(GL_POSITION, ...) which @@ -1018,7 +1019,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d, const short do_light = (v3d->drawtype >= OB_SOLID); /* hide faces in face select mode */ - if (draw_flags & DRAW_FACE_SELECT) + if (me->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL)) facemask = wpaint__setSolidDrawOptions_facemask; if (ob->mode & OB_MODE_WEIGHT_PAINT) { @@ -1066,12 +1067,18 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d, draw_mesh_face_select(rv3d, me, dm); } else if ((do_light == FALSE) || (ob->dtx & OB_DRAWWIRE)) { + const int use_depth = (v3d->flag & V3D_ZBUF_SELECT); /* weight paint in solid mode, special case. focus on making the weights clear * rather than the shading, this is also forced in wire view */ - bglPolygonOffset(rv3d->dist, 1.0); - glDepthMask(0); /* disable write in zbuffer, selected edge wires show better */ + if (use_depth) { + bglPolygonOffset(rv3d->dist, 1.0); + glDepthMask(0); /* disable write in zbuffer, selected edge wires show better */ + } + else { + glDisable(GL_DEPTH_TEST); + } glEnable(GL_BLEND); glColor4ub(255, 255, 255, 96); @@ -1080,8 +1087,14 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d, dm->drawEdges(dm, 1, 1); - bglPolygonOffset(rv3d->dist, 0.0); - glDepthMask(1); + if (use_depth) { + bglPolygonOffset(rv3d->dist, 0.0); + glDepthMask(1); + } + else { + glEnable(GL_DEPTH_TEST); + } + glDisable(GL_LINE_STIPPLE); glDisable(GL_BLEND); } |