diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2016-05-16 11:13:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-09 22:38:17 +0300 |
commit | 6798809c7ec8388509f541a64359b3d107e6fd3f (patch) | |
tree | cab8d4b80cfca2974814af7598248edd6368b6e5 /source/blender/editors/space_view3d/view3d_draw.c | |
parent | d733826708f9b562687b78424e5c0835cba8c3c9 (diff) |
Flat shading for basic shader
The purpose of the patch is to replace deprecated glShadeModel.
To decrease glShadeModel calls I've set GL_SMOOTH by default
Reviewers: merwin, brecht
Reviewed By: brecht
Subscribers: blueprintrandom, Evgeny_Rodygin, AlexKowel, yurikovelenov
Differential Revision: https://developer.blender.org/D1958
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 14 |
1 files changed, 2 insertions, 12 deletions
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); |