Fix/workaround for GLSL textured and matcap modes for dyntopo

Currently used special checks in DM draw code, perhaps better would be
simply to flush changes from PBVH to DM.

Anyway, now things seems to be working OK, will check on better solution
from code point of view later.
This commit is contained in:
Sergey Sharybin 2013-01-22 16:06:09 +00:00
parent e7ed4605eb
commit 78f5d531a4

@ -1111,6 +1111,19 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
index_mp_to_orig = NULL;
}
/* TODO: same as for solid draw, not entirely correct, but works fine for now,
* will skip using textures (dyntopo currently destroys UV anyway) and
* works fine for matcap
*/
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
setMaterial(1, &gattribs);
BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
}
return;
}
cdDM_update_normals_from_pbvh(dm);
matnr = -1;
@ -1412,6 +1425,19 @@ static void cdDM_drawMappedFacesMat(DerivedMesh *dm,
index_mp_to_orig = NULL;
}
/* TODO: same as for solid draw, not entirely correct, but works fine for now,
* will skip using textures (dyntopo currently destroys UV anyway) and
* works fine for matcap
*/
if (cddm->pbvh && cddm->pbvh_draw && BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) {
if (dm->numTessFaceData) {
setMaterial(userData, 1, NULL);
BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, FALSE);
}
return;
}
cdDM_update_normals_from_pbvh(dm);
matnr = -1;