diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-05 19:29:43 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-08-05 19:29:43 +0300 |
commit | 02f553cc7a399767b0466cb92a071db885570443 (patch) | |
tree | b7e8e25be26b7d12eeb70d32c4297674de0c4071 /source | |
parent | 9a995c11d3fe6f3d2462b636dc14e5bed0804ac1 (diff) |
OpenSubdiv: Changes to texturing
Use first material slot for until multiple materials are fully supported.
Also respect setMaterial()'s return value to avoid drawing unnecessary
geometry.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index aa3001630ef..02a7f6c8693 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -2632,11 +2632,10 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) draw_smooth = true; new_matnr = 1; } - if (setMaterial) { - setMaterial(new_matnr, NULL); + if (setMaterial && setMaterial(new_matnr, NULL)) { + glShadeModel(draw_smooth ? GL_SMOOTH : GL_FLAT); + ccgSubSurf_drawGLMesh(ss, true, -1, -1); } - glShadeModel(draw_smooth ? GL_SMOOTH : GL_FLAT); - ccgSubSurf_drawGLMesh(ss, true, -1, -1); return; } #endif @@ -2691,8 +2690,9 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, new_matnr = 1; } glShadeModel(draw_smooth ? GL_SMOOTH : GL_FLAT); - setMaterial(new_matnr, &gattribs); - ccgSubSurf_drawGLMesh(ss, true, -1, -1); + if (setMaterial(new_matnr, &gattribs)) { + ccgSubSurf_drawGLMesh(ss, true, -1, -1); + } return; } #endif @@ -4544,7 +4544,8 @@ static void set_ccgdm_gpu_geometry(CCGDerivedMesh *ccgdm, DerivedMesh *dm) for (index = 0; index < totface; index++) { faceFlags->flag = mpoly ? mpoly[index].flag : 0; - faceFlags->mat_nr = mpoly ? mpoly[index].mat_nr : 0; + /* faceFlags->mat_nr = mpoly ? mpoly[index].mat_nr : 0; */ + faceFlags->mat_nr = 0; faceFlags++; } |