diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-22 15:46:13 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-07-22 15:56:15 +0300 |
commit | 48c4b700dce0b326e1b905e133c0db1217a5cae0 (patch) | |
tree | d520f9d02eeaa7deb7774ed4dca84bdedd0d7914 /source/blender/blenkernel | |
parent | 98970f71fe95e6b842582f5b71f3081798a8f54a (diff) |
OpenSubdiv: Lay down fundamentals to support multiple UV maps
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 14 |
3 files changed, 12 insertions, 10 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h index a825cffe7a0..72f386bf246 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.h +++ b/source/blender/blenkernel/intern/CCGSubSurf.h @@ -205,7 +205,7 @@ void ccgSubSurf_checkTopologyChanged(CCGSubSurf *ss, struct DerivedMesh *dm); void ccgSubSurf_prepareTopologyRefiner(CCGSubSurf *ss, struct DerivedMesh *dm); /* Make sure GL mesh exists, up to date and ready to draw. */ -bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss, bool use_osd_glsl); +bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss, bool use_osd_glsl, int active_uv_index); /* Draw given partitions of the GL mesh. * diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c index c715c1fa1ee..9dc1a71adab 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c @@ -215,7 +215,9 @@ static void ccgSubSurf__updateGLMeshCoords(CCGSubSurf *ss) ss->osd_num_coarse_coords); } -bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss, bool use_osd_glsl) +bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss, + bool use_osd_glsl, + int active_uv_index) { int compute_type; @@ -288,7 +290,7 @@ bool ccgSubSurf_prepareGLMesh(CCGSubSurf *ss, bool use_osd_glsl) ss->osd_coarse_coords_invalid = false; } - openSubdiv_osdGLMeshDisplayPrepare(use_osd_glsl); + openSubdiv_osdGLMeshDisplayPrepare(use_osd_glsl, active_uv_index); return true; } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index b9efe23a4b3..c6e20b995ba 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1801,7 +1801,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, bool drawLooseEdges, bool drawAllEd #ifdef WITH_OPENSUBDIV if (ccgdm->useGpuBackend) { /* TODO(sergey): We currently only support all edges drawing. */ - if (ccgSubSurf_prepareGLMesh(ccgdm->ss, true)) { + if (ccgSubSurf_prepareGLMesh(ccgdm->ss, true, -1)) { ccgSubSurf_drawGLMesh(ccgdm->ss, false, -1, -1); } return; @@ -2638,7 +2638,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) int mat_nr = -1; bool draw_smooth = false; int start_draw_patch = -1, num_draw_patches = 0; - if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, setMaterial != NULL) == false)) { + if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, setMaterial != NULL, -1) == false)) { return; } if (setMaterial == NULL) { @@ -2750,7 +2750,7 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, bool draw_smooth = false; int start_draw_patch = -1, num_draw_patches = 0; GPU_draw_update_fvar_offset(dm); - if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, false) == false)) { + if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, false, -1) == false)) { return; } for (i = 0; i < num_base_faces; ++i) { @@ -3193,7 +3193,7 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, int new_matnr; bool draw_smooth; GPU_draw_update_fvar_offset(dm); - if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true) == false)) { + if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true, -1) == false)) { return; } /* TODO(sergey): Single matierial currently. */ @@ -3401,7 +3401,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm, #ifdef WITH_OPENSUBDIV if (ccgdm->useGpuBackend) { - if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true) == false)) { + if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true, -1) == false)) { return; } if (drawParams == NULL) { @@ -3639,7 +3639,7 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, */ glColor3f(0.8f, 0.8f, 0.8f); } - if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true) == false)) { + if (UNLIKELY(ccgSubSurf_prepareGLMesh(ss, true, -1) == false)) { return; } if (faceFlags) { @@ -3838,7 +3838,7 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm, #ifdef WITH_OPENSUBDIV if (ccgdm->useGpuBackend) { /* TODO(sergey): Only draw edges from base mesh. */ - if (ccgSubSurf_prepareGLMesh(ccgdm->ss, true)) { + if (ccgSubSurf_prepareGLMesh(ccgdm->ss, true, -1)) { if (!setDrawOptions || (setDrawOptions(userData, 0) != DM_DRAW_OPTION_SKIP)) { ccgSubSurf_drawGLMesh(ccgdm->ss, false, -1, -1); } |