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>2015-07-17 19:30:40 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-07-17 19:30:40 +0300
commit3a15ec337ef2bea094e284963584d8fb320520bd (patch)
treeadc219779f1c8f6165079ea5522a4f5dd81b18ca
parent85809e836e26d4e0e76ea19172af219ec4bb6318 (diff)
Fix issue reported by scorpion81 on irc: material mode + flat shading
artifacts in cycles textured mode.
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index d5cdc50df65..9c2577193ce 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -1126,6 +1126,9 @@ static void cdDM_drawMappedFacesMat(
* will skip using textures (dyntopo currently destroys UV anyway) and
* works fine for matcap
*/
+
+ cdDM_update_normals_from_pbvh(dm);
+
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (BKE_pbvh_has_faces(cddm->pbvh)) {
setMaterial(userData, 1, &gattribs);
@@ -1135,8 +1138,6 @@ static void cdDM_drawMappedFacesMat(
return;
}
- cdDM_update_normals_from_pbvh(dm);
-
matnr = -1;
glShadeModel(GL_SMOOTH);
@@ -1166,7 +1167,7 @@ static void cdDM_drawMappedFacesMat(
/* skipping faces */
if (setFace) {
- orig = (index_mp_to_orig) ? index_mp_to_orig[a] : lt->poly;
+ orig = (index_mp_to_orig) ? index_mp_to_orig[lt->poly] : lt->poly;
if (orig != ORIGINDEX_NONE && !setFace(userData, orig))
continue;
@@ -1175,7 +1176,7 @@ static void cdDM_drawMappedFacesMat(
/* smooth normal */
if (!smoothnormal) {
if (nors) {
- glNormal3fv(nors[a]);
+ glNormal3fv(nors[lt->poly]);
}
else {
/* TODO ideally a normal layer should always be available */