diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-07-31 23:52:37 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-07-31 23:52:37 +0300 |
commit | 1c626f823db0136317ee867dde0c778ab785070c (patch) | |
tree | f2d73eaa55de9f1e493304df2d95b453d618398d /source/blender/blenkernel/intern/cdderivedmesh.c | |
parent | 527ee3f1f1ff81d0240c263579ef42be714cac71 (diff) |
Complete fix for T45618
Two issues here, normal update was not happening due to own sillyness in
viewport refactor, also normal update code still used triangles.
Now reused Campbell's poly normal recalculation code.
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index dde04104654..19c4e66f7eb 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -450,6 +450,8 @@ static void cdDM_drawFacesSolid( if (BKE_pbvh_has_faces(cddm->pbvh)) { float (*face_nors)[3] = CustomData_get_layer(&dm->faceData, CD_NORMAL); + cdDM_update_normals_from_pbvh(dm); + BKE_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, setMaterial, false, false); glShadeModel(GL_FLAT); @@ -505,6 +507,7 @@ static void cdDM_drawFacesTex_common( */ if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) { if (BKE_pbvh_has_faces(cddm->pbvh)) { + cdDM_update_normals_from_pbvh(dm); GPU_set_tpage(NULL, false, false); BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false, false); } @@ -523,8 +526,6 @@ static void cdDM_drawFacesTex_common( mloopcol = dm->getLoopDataArray(dm, colType); } - cdDM_update_normals_from_pbvh(dm); - GPU_vertex_setup(dm); GPU_normal_setup(dm); GPU_triangle_setup(dm); @@ -700,8 +701,6 @@ static void cdDM_drawMappedFaces( } } else { - cdDM_update_normals_from_pbvh(dm); - GPU_normal_setup(dm); if (useColors) { @@ -880,6 +879,7 @@ static void cdDM_drawMappedFacesGLSL( */ if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) { if (BKE_pbvh_has_faces(cddm->pbvh)) { + cdDM_update_normals_from_pbvh(dm); setMaterial(1, &gattribs); BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false, false); } @@ -887,8 +887,6 @@ static void cdDM_drawMappedFacesGLSL( return; } - cdDM_update_normals_from_pbvh(dm); - matnr = -1; do_draw = false; @@ -1149,10 +1147,9 @@ static void cdDM_drawMappedFacesMat( * works fine for matcap */ - cdDM_update_normals_from_pbvh(dm); - if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) { if (BKE_pbvh_has_faces(cddm->pbvh)) { + cdDM_update_normals_from_pbvh(dm); setMaterial(userData, 1, &gattribs); BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, false, false); } |