Merge with trunk r39928
[blender-staging.git] / source / blender / blenkernel / intern / subsurf_ccg.c
index 186a5ea1852926ed30427b60e44b88806a04f7d1..bcba812fe243d8bd8a1d76cb8ae1c70a42b8c410 100644 (file)
@@ -1828,11 +1828,14 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u
                                          glEnable(GL_POLYGON_STIPPLE);
                                          glPolygonStipple(stipple_quarttone);
                                }
+
+                               /* dont set shading mode to flat because
+                               *  normals are used to change shading */
+                               glShadeModel(GL_SMOOTH);
                                
                                for (S=0; S<numVerts; S++) {
                                        DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
                                        if (drawSmooth) {
-                                               glShadeModel(GL_SMOOTH);
                                                for (y=0; y<gridFaces; y++) {
                                                        DMGridData *a, *b;
                                                        glBegin(GL_QUAD_STRIP);
@@ -1867,7 +1870,6 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u
                                                        glEnd();
                                                }
                                        } else {
-                                               glShadeModel(GL_FLAT);
                                                glBegin(GL_QUADS);
                                                for (y=0; y<gridFaces; y++) {
                                                        for (x=0; x<gridFaces; x++) {