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:
authorAntony Riakiotakis <kalast@gmail.com>2014-04-08 02:24:45 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-04-08 02:25:49 +0400
commitcced07661a4fcfd156caec81073d97c060677a15 (patch)
tree5db2418dda3ecb28d126cb33a67695b23e8a7542
parent1e6d2b1dbf1a6316608fbfad81cf5b2ad147eb05 (diff)
Matcaps.
Instead of setting color every time, just set it on material enable. Handles all cases of surfaces. Thanks to Campbell for pointing out!
-rw-r--r--source/blender/editors/space_view3d/drawobject.c4
-rw-r--r--source/blender/gpu/intern/gpu_draw.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index cfb4e1f6b70..61866b60a8c 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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;
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 64ab701acba..99f98f713ce 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -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 */