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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user