add a guard (if dirty) on uniform update

This commit is contained in:
Julien Valentin
2017-08-30 15:46:19 +02:00
parent 8fad310ce1
commit 705695b41d

View File

@@ -187,11 +187,14 @@ void MorphTransformHardware::operator()(MorphGeometry& geom)
if (_needInit)
if (!init(geom))
return;
///upload new morph weights each update via uniform
int curimorph=0;
MorphGeometry::MorphTargetList & morphlist=geom.getMorphTargetList();
for(MorphGeometry::MorphTargetList::const_iterator curmorph=morphlist.begin(); curmorph!=morphlist.end(); ++curmorph)
_uniformTargetsWeight->setElement(curimorph++, curmorph->getWeight());
_uniformTargetsWeight->dirty();
if (geom.isDirty())
{
///upload new morph weights each update via uniform
int curimorph=0;
MorphGeometry::MorphTargetList & morphlist=geom.getMorphTargetList();
for(MorphGeometry::MorphTargetList::const_iterator curmorph=morphlist.begin(); curmorph!=morphlist.end(); ++curmorph)
_uniformTargetsWeight->setElement(curimorph++, curmorph->getWeight());
_uniformTargetsWeight->dirty();
geom.dirty(false);
}
}