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:
authorAlexander Romanov <a.romanov@blend4web.com>2016-05-16 11:13:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-06-09 22:38:17 +0300
commit6798809c7ec8388509f541a64359b3d107e6fd3f (patch)
treecab8d4b80cfca2974814af7598248edd6368b6e5 /source/blender/gpu/intern/gpu_buffers.c
parentd733826708f9b562687b78424e5c0835cba8c3c9 (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/gpu/intern/gpu_buffers.c')
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index e8605e27595..35bfc687052 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1863,10 +1863,14 @@ void GPU_draw_pbvh_buffers(GPU_PBVH_Buffers *buffers, DMSetMaterial setMaterial,
GPU_buffer_bind(buffers->index_buf, GPU_BINDING_INDEX);
}
- if (wireframe)
+ if (wireframe) {
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- else
- glShadeModel((buffers->smooth || buffers->face_indices_len) ? GL_SMOOTH : GL_FLAT);
+ }
+ else {
+ bound_options = GPU_basic_shader_bound_options();
+ GPU_basic_shader_bind(bound_options | ((buffers->smooth || buffers->face_indices_len) ?
+ 0 : GPU_SHADER_FLAT_NORMAL));
+ }
if (buffers->tot_quad) {
const char *offset = base;