bugfix on edge rendering bo manager

This commit is contained in:
alemuntoni 2021-07-15 18:52:45 +02:00
parent f1530c585b
commit bc07a00def
1 changed files with 17 additions and 15 deletions

View File

@ -35,7 +35,7 @@
#include <wrap/gl/math.h> #include <wrap/gl/math.h>
#include <vcg/space/color4.h> #include <vcg/space/color4.h>
#include <vcg/math/matrix44.h> #include <vcg/math/matrix44.h>
#include<wrap/system/memory_info.h> #include <wrap/system/memory_info.h>
#include <wrap/gl/gl_mesh_attributes_info.h> #include <wrap/gl/gl_mesh_attributes_info.h>
@ -1158,12 +1158,19 @@ namespace vcg
triangles += cit->second - cit->first + 1; triangles += cit->second - cit->first + 1;
} }
if (attributestobeupdated[INT_ATT_NAMES::ATT_WEDGETEXTURE] || attributestobeupdated[INT_ATT_NAMES::ATT_VERTTEXTURE])
_texindnumtriangles[t] = std::make_pair(mit->first, triangles);
++t;
}
if ((attributestobeupdated[INT_ATT_NAMES::ATT_EDGEINDICES]) && (_edge.size() > 0)) if ((attributestobeupdated[INT_ATT_NAMES::ATT_EDGEINDICES]) && (_edge.size() > 0))
{ {
for (typename std::vector<EdgeVertInd>::iterator it = _edge.begin(); it != _edge.end(); ++it) unsigned int i = 0;
for (EdgeVertInd& e : _edge)
{ {
it->_v[0] = vpatlas[it->_v[0]]; e._v[0] = vpatlas[e._v[0]];
it->_v[1] = vpatlas[it->_v[1]]; e._v[1] = vpatlas[e._v[1]];
++i;
} }
GLBufferObject* buffobj = _bo[INT_ATT_NAMES::ATT_EDGEINDICES]; GLBufferObject* buffobj = _bo[INT_ATT_NAMES::ATT_EDGEINDICES];
@ -1172,11 +1179,6 @@ namespace vcg
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
} }
if (attributestobeupdated[INT_ATT_NAMES::ATT_WEDGETEXTURE] || attributestobeupdated[INT_ATT_NAMES::ATT_VERTTEXTURE])
_texindnumtriangles[t] = std::make_pair(mit->first, triangles);
++t;
}
//return (k != tn) //return (k != tn)
// throw MeshLabException("Mesh has not been properly partitioned"); // throw MeshLabException("Mesh has not been properly partitioned");
return true; return true;