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!).
This commit is contained in:
Bastien Montagne 2014-05-12 15:50:59 +02:00
parent a7918ea40e
commit 70303dfefe
Notes: blender-bot 2023-02-14 10:42:33 +01:00
Referenced by issue #40162, Vertex Connect creates extra face when cutting through non-planar NGon.
Referenced by issue #40014, Broken shading with mirror modifier and auto smooth normals while hiding verts.
1 changed files with 12 additions and 6 deletions

View File

@ -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 */