add parameter to XXXTranformHW to customize reserved texture attribs and vertex attribs

This commit is contained in:
Julien Valentin
2017-08-30 17:07:11 +02:00
parent 705695b41d
commit 86ad54f671
4 changed files with 26 additions and 19 deletions

View File

@@ -20,12 +20,13 @@
using namespace osgAnimation;
#define DEFAULT_FIRST_VERTATTRIB_TARGETTED 11
RigTransformHardware::RigTransformHardware()
{
_needInit = true;
_bonesPerVertex = 0;
_nbVertexes = 0;
_minAttribIndex = DEFAULT_FIRST_VERTATTRIB_TARGETTED;
}
RigTransformHardware::RigTransformHardware(const RigTransformHardware& rth, const osg::CopyOp& copyop):
@@ -37,7 +38,8 @@ RigTransformHardware::RigTransformHardware(const RigTransformHardware& rth, cons
_boneWeightAttribArrays(rth._boneWeightAttribArrays),
_uniformMatrixPalette(rth._uniformMatrixPalette),
_shader(rth._shader),
_needInit(rth._needInit)
_needInit(rth._needInit),
_minAttribIndex(rth._minAttribIndex)
{
}
@@ -198,7 +200,7 @@ bool RigTransformHardware::prepareData(RigGeometry& rig)
OSG_INFO << "Shader " << str << std::endl;
}
unsigned int attribIndex = 11;
unsigned int attribIndex = _minAttribIndex;
unsigned int nbAttribs = getNumVertexAttrib();
if(nbAttribs==0)
OSG_WARN << "nbAttribs== " << nbAttribs << std::endl;