Instead of setting color every time, just set it on material enable.
Handles all cases of surfaces. Thanks to Campbell for pointing out!
This commit is contained in:
Antony Riakiotakis
2014-04-08 01:24:45 +03:00
parent 1e6d2b1dbf
commit cced07661a
2 changed files with 3 additions and 4 deletions

View File

@@ -3190,8 +3190,6 @@ static void draw_em_fancy(Scene *scene, ARegion *ar, View3D *v3d,
}
else if (check_object_draw_texture(scene, v3d, dt)) {
if (draw_glsl_material(scene, ob, v3d, dt)) {
/* this will be ignored mostly, but is relevant for matcaps */
glColor3f(1.0f, 1.0f, 1.0f);
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
finalDM->drawMappedFacesGLSL(finalDM, GPU_enable_material,
@@ -3471,8 +3469,6 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
Paint *p;
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
/* this will get ignored mostly, will only be relevant for matcaps */
glColor3f(1.0, 1.0, 1.0);
if ((v3d->flag2 & V3D_SHOW_SOLID_MATCAP) && ob->sculpt && (p = BKE_paint_get_active(scene))) {
GPUVertexAttribs gattribs;

View File

@@ -1597,6 +1597,9 @@ int GPU_enable_material(int nr, void *attribs)
else
glDisable(GL_CULL_FACE);
}
if (GMS.use_matcaps)
glColor3f(1.0, 1.0, 1.0f);
}
else {
/* or do fixed function opengl material */