diff options
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawmesh.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 29 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 14 |
5 files changed, 9 insertions, 49 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 9872b05da63..cf738de0202 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -130,7 +130,6 @@ void draw_motion_path_instance(Scene *scene, mpv_start = (mpath->points + sind); /* draw curve-line of path */ - glShadeModel(GL_SMOOTH); glBegin(GL_LINE_STRIP); for (i = 0, mpv = mpv_start; i < len; i++, mpv++) { @@ -187,7 +186,6 @@ void draw_motion_path_instance(Scene *scene, } glEnd(); - glShadeModel(GL_FLAT); glPointSize(1.0); diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 1306e832592..1d9a515a5f2 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -431,10 +431,9 @@ static void draw_bonevert_solid(void) glNewList(displist, GL_COMPILE); qobj = gluNewQuadric(); - gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); + gluQuadricDrawStyle(qobj, GLU_FILL); + /* Draw tips of a bone */ gluSphere(qobj, 0.05, 8, 5); - glShadeModel(GL_FLAT); gluDeleteQuadric(qobj); glEndList(); @@ -890,7 +889,6 @@ static void draw_sphere_bone(const short dt, int armflag, int boneflag, short co GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR); gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); } else { gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); @@ -968,7 +966,6 @@ static void draw_sphere_bone(const short dt, int armflag, int boneflag, short co /* restore */ if (dt == OB_SOLID) { - glShadeModel(GL_FLAT); GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); } @@ -1770,7 +1767,6 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, /* and draw blended distances */ if (arm->flag & ARM_POSEMODE) { glEnable(GL_BLEND); - //glShadeModel(GL_SMOOTH); if (v3d->zbuf) glDisable(GL_DEPTH_TEST); @@ -1793,7 +1789,6 @@ static void draw_pose_bones(Scene *scene, View3D *v3d, ARegion *ar, Base *base, if (v3d->zbuf) glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND); - //glShadeModel(GL_FLAT); } } @@ -2217,7 +2212,6 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt) /* and draw blended distances */ glEnable(GL_BLEND); - //glShadeModel(GL_SMOOTH); if (v3d->zbuf) glDisable(GL_DEPTH_TEST); @@ -2232,7 +2226,6 @@ static void draw_ebones(View3D *v3d, ARegion *ar, Object *ob, const short dt) if (v3d->zbuf) glEnable(GL_DEPTH_TEST); glDisable(GL_BLEND); - //glShadeModel(GL_FLAT); } /* if solid we draw it first */ diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 883f06763de..d8364011036 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -496,7 +496,6 @@ static void draw_textured_begin(Scene *scene, View3D *v3d, RegionView3D *rv3d, O memcpy(Gtexdraw.obcol, obcol, sizeof(obcol)); set_draw_settings_cached(1, NULL, NULL, Gtexdraw); - glShadeModel(GL_SMOOTH); glCullFace(GL_BACK); } @@ -528,7 +527,6 @@ static void draw_textured_end(void) GPU_set_tpage(NULL, 0, 0); } - glShadeModel(GL_FLAT); glDisable(GL_CULL_FACE); GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 848772600ba..5d1c0bfa72e 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1592,12 +1592,9 @@ static void draw_bundle_sphere(void) displist = glGenLists(1); glNewList(displist, GL_COMPILE); - qobj = gluNewQuadric(); gluQuadricDrawStyle(qobj, GLU_FILL); - glShadeModel(GL_SMOOTH); gluSphere(qobj, 0.05, 8, 8); - glShadeModel(GL_FLAT); gluDeleteQuadric(qobj); glEndList(); @@ -1779,8 +1776,6 @@ static void draw_viewport_reconstruction( GPU_basic_shader_colors(NULL, NULL, 0, 1.0f); GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_USE_COLOR); - glShadeModel(GL_SMOOTH); - tracking_object = tracking->objects.first; while (tracking_object) { draw_viewport_object_reconstruction( @@ -1791,7 +1786,6 @@ static void draw_viewport_reconstruction( } /* restore */ - glShadeModel(GL_FLAT); GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); if ((dflag & DRAW_CONSTCOLOR) == 0) { @@ -2351,7 +2345,6 @@ static void drawlattice(View3D *v3d, Object *ob) if (ob->defbase.first && lt->dvert) { actdef_wcol = ob->actdef; - glShadeModel(GL_SMOOTH); } } @@ -2380,10 +2373,6 @@ static void drawlattice(View3D *v3d, Object *ob) } } glEnd(); - - /* restoration for weight colors */ - if (actdef_wcol) - glShadeModel(GL_FLAT); if (is_edit) { BPoint *actbp = BKE_lattice_active_point_get(lt); @@ -3248,17 +3237,15 @@ static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d, ((ts->selectmode & SCE_SELECT_VERTEX) || (me->drawflag & ME_DRAWEIGHT))) { if (draw_dm_edges_weight_check(me, v3d)) { - glShadeModel(GL_SMOOTH); + // Interpolate vertex weights draw_dm_edges_weight_interp(em, cageDM, ts->weightuser); - glShadeModel(GL_FLAT); } else if (ts->selectmode == SCE_SELECT_FACE) { draw_dm_edges_sel(em, cageDM, wireCol, selCol, actCol, eed_act); } else { - glShadeModel(GL_SMOOTH); + // Interpolate vertex selection draw_dm_edges_sel_interp(em, cageDM, wireCol, selCol); - glShadeModel(GL_FLAT); } } else { @@ -4461,10 +4448,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag, glEnableClientState(GL_VERTEX_ARRAY); - if (ob->type == OB_MBALL) { /* mball always smooth shaded */ - glShadeModel(GL_SMOOTH); - } - /* track current material, -1 for none (needed for lines) */ short col = -1; @@ -4486,7 +4469,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag, // glVertexPointer(3, GL_FLOAT, 0, dl->verts); // glDrawArrays(GL_LINE_STRIP, 0, dl->nr); - glBegin(GL_LINE_STRIP); for (int nr = dl->nr; nr; nr--, data += 3) glVertex3fv(data); @@ -4517,15 +4499,15 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag, GPU_object_material_bind(dl->col + 1, use_glsl ? &gattribs : NULL); col = dl->col; } - - if (dl->rt & CU_SMOOTH) glShadeModel(GL_SMOOTH); - else glShadeModel(GL_FLAT); + /* FLAT/SMOOTH shading for surfaces */ + glShadeModel((dl->rt & CU_SMOOTH) ? GL_SMOOTH : GL_FLAT); glEnableClientState(GL_NORMAL_ARRAY); glVertexPointer(3, GL_FLOAT, 0, dl->verts); glNormalPointer(GL_FLOAT, 0, dl->nors); glDrawElements(GL_QUADS, 4 * dl->totindex, GL_UNSIGNED_INT, dl->index); glDisableClientState(GL_NORMAL_ARRAY); + glShadeModel(GL_SMOOTH); } break; @@ -4570,7 +4552,6 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag, } glDisableClientState(GL_VERTEX_ARRAY); - glShadeModel(GL_FLAT); glFrontFace(GL_CCW); if (col != -1) { diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 445a4cbdfd6..bdc2234e246 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -657,7 +657,6 @@ static void draw_rotation_guide(RegionView3D *rv3d) glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glShadeModel(GL_SMOOTH); glPointSize(5); glEnable(GL_POINT_SMOOTH); glDepthMask(0); /* don't overwrite zbuf */ @@ -2999,18 +2998,16 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) glLoadIdentity(); glColor4f(0.0f, 0.0f, 0.0f, 1.0f); } - + // Draw world glEnable(GL_DEPTH_TEST); glDepthFunc(GL_ALWAYS); - glShadeModel(GL_SMOOTH); glBegin(GL_TRIANGLE_STRIP); glVertex3f(-1.0, -1.0, 1.0); glVertex3f(1.0, -1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0); glVertex3f(1.0, 1.0, 1.0); glEnd(); - glShadeModel(GL_FLAT); - + // if (material_not_bound) { glMatrixMode(GL_PROJECTION); glPopMatrix(); @@ -3048,8 +3045,6 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) glPushMatrix(); glLoadIdentity(); - glShadeModel(GL_SMOOTH); - /* calculate buffers the first time only */ if (!buf_calculated) { for (x = 0; x < VIEWGRAD_RES_X; x++) { @@ -3135,8 +3130,6 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) glMatrixMode(GL_MODELVIEW); glPopMatrix(); - glShadeModel(GL_FLAT); - #undef VIEWGRAD_RES_X #undef VIEWGRAD_RES_Y } @@ -3160,7 +3153,6 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) glEnable(GL_DEPTH_TEST); glDepthFunc(GL_ALWAYS); - glShadeModel(GL_SMOOTH); glBegin(GL_QUADS); UI_ThemeColor(TH_LOW_GRAD); glVertex3f(-1.0, -1.0, 1.0); @@ -3169,8 +3161,6 @@ static void view3d_main_region_clear(Scene *scene, View3D *v3d, ARegion *ar) glVertex3f(1.0, 1.0, 1.0); glVertex3f(-1.0, 1.0, 1.0); glEnd(); - glShadeModel(GL_FLAT); - glDepthFunc(GL_LEQUAL); glDisable(GL_DEPTH_TEST); |