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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-05-12 17:50:59 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-05-12 17:52:19 +0400
commit70303dfefe4ccd28434eb2804985b2b78652b65b (patch)
tree09fb1cbddfae90a24e42ef899dd781cdc7dcb07b /source/blender/blenkernel/intern/cdderivedmesh.c
parenta7918ea40e4972b19e1f8441a249e93e969a7736 (diff)
Fix T40014: Broken shading with mirror modifier and auto smooth normals while hiding verts.
Stupid mistake that showed only when there was some hidden faces (lnors should always be increased... even when the face is not drawned!).
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 205282c1de7..ba8fe83155e 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -597,7 +597,6 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
glNormal3sv((const GLshort *)lnors[0][3]);
glVertex3fv(mvert[mface->v4].co);
}
- lnors++;
}
else if (shademodel == GL_FLAT) {
if (nors) {
@@ -635,7 +634,10 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
}
}
- if (nors) nors += 3;
+ if (nors)
+ nors += 3;
+ if (lnors)
+ lnors++;
}
glEnd();
}
@@ -799,11 +801,13 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
else if (mf->flag & ME_SMOOTH) glNormal3sv(mvert->no);
glVertex3fv(mvert->co);
}
- if (lnors) lnors++;
glEnd();
}
- if (nors) nors += 3;
+ if (nors)
+ nors += 3;
+ if (lnors)
+ lnors++;
}
}
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
@@ -973,7 +977,6 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
glNormal3sv((const GLshort *)lnors[0][3]);
glVertex3fv(mv[mf->v4].co);
}
- lnors++;
}
else if (!drawSmooth) {
if (nors) {
@@ -1024,7 +1027,10 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
glDisable(GL_POLYGON_STIPPLE);
}
- if (nors) nors += 3;
+ if (nors)
+ nors += 3;
+ if (lnors)
+ lnors++;
}
}
else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */