Merge branch 'master' into blender2.8

This commit is contained in:
2016-06-10 05:46:29 +10:00
6 changed files with 15 additions and 12 deletions

View File

@@ -432,7 +432,7 @@ static void draw_bonevert_solid(void)
qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
// Draw tips of a bone
/* Draw tips of a bone */
gluSphere(qobj, 0.05, 8, 5);
gluDeleteQuadric(qobj);

View File

@@ -4492,9 +4492,8 @@ static void drawDispListsolid(ListBase *lb, Object *ob, const short dflag,
GPU_object_material_bind(dl->col + 1, use_glsl ? &gattribs : NULL);
col = dl->col;
}
// FLAT/SMOOTH shading for surfaces
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);

View File

@@ -509,11 +509,12 @@ void GPU_basic_shader_bind(int options)
glDisable(GL_POLYGON_STIPPLE);
}
if (options & GPU_SHADER_FLAT_NORMAL)
if (options & GPU_SHADER_FLAT_NORMAL) {
glShadeModel(GL_FLAT);
else
}
else {
glShadeModel(GL_SMOOTH);
}
}
GPU_MATERIAL_STATE.bound_options = options;

View File

@@ -1863,11 +1863,13 @@ 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 {
bound_options = GPU_basic_shader_bound_options();
GPU_basic_shader_bind(bound_options | ((buffers->smooth || buffers->face_indices_len) ? 0 : GPU_SHADER_FLAT_NORMAL));
GPU_basic_shader_bind(bound_options | ((buffers->smooth || buffers->face_indices_len) ?
0 : GPU_SHADER_FLAT_NORMAL));
}
if (buffers->tot_quad) {

View File

@@ -1961,8 +1961,9 @@ int GPU_object_material_bind(int nr, void *attribs)
}
else {
/* or do fixed function opengl material */
GPU_basic_shader_colors(GMS.matbuf[nr].diff,
GMS.matbuf[nr].spec, GMS.matbuf[nr].hard, GMS.matbuf[nr].alpha);
GPU_basic_shader_colors(
GMS.matbuf[nr].diff,
GMS.matbuf[nr].spec, GMS.matbuf[nr].hard, GMS.matbuf[nr].alpha);
if (GMS.two_sided_lighting)
GPU_basic_shader_bind(GPU_SHADER_LIGHTING | GPU_SHADER_TWO_SIDED);

View File

@@ -36,7 +36,7 @@ void main()
varying_normal = normalize(gl_NormalMatrix * gl_Normal);
#endif
#if defined(USE_FLAT_NORMAL)
// transform vertex into eyespace
/* transform vertex into eyespace */
eyespace_vert_pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
#endif