Fixes for osgFX.

This commit is contained in:
Robert Osfield
2003-09-10 12:38:28 +00:00
parent a01903ac41
commit 6c22afa51c
9 changed files with 211 additions and 14 deletions

View File

@@ -586,11 +586,11 @@ void BumpMapping::prepareGeometry(osg::Geometry *geo)
osg::ref_ptr<osgUtil::TangentSpaceGenerator> tsg = new osgUtil::TangentSpaceGenerator;
tsg->generate(geo, normalunit_);
if (!geo->getVertexAttribArray(6))
geo->setVertexAttribData(6, osg::Geometry::ArrayData(tsg->getTangentArray(), osg::Geometry::BIND_PER_VERTEX,GL_TRUE));
geo->setVertexAttribData(6, osg::Geometry::ArrayData(tsg->getTangentArray(), osg::Geometry::BIND_PER_VERTEX,GL_FALSE));
if (!geo->getVertexAttribArray(7))
geo->setVertexAttribData(7, osg::Geometry::ArrayData(tsg->getBinormalArray(), osg::Geometry::BIND_PER_VERTEX, GL_TRUE));
geo->setVertexAttribData(7, osg::Geometry::ArrayData(tsg->getBinormalArray(), osg::Geometry::BIND_PER_VERTEX, GL_FALSE));
if (!geo->getVertexAttribArray(15))
geo->setVertexAttribData(15, osg::Geometry::ArrayData(tsg->getNormalArray(), osg::Geometry::BIND_PER_VERTEX, GL_TRUE));
geo->setVertexAttribData(15, osg::Geometry::ArrayData(tsg->getNormalArray(), osg::Geometry::BIND_PER_VERTEX, GL_FALSE));
}
void BumpMapping::prepareNode(osg::Node *node)

View File

@@ -314,7 +314,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
}
Geometry::AttributeBinding vertexAttribBinding=Geometry::BIND_OFF;
if (fr.matchSequence("VertexAttribBinding %i %s") && Geometry_matchBindingTypeStr(fr[2].getStr(),vertexAttribBinding))
if (fr.matchSequence("VertexAttribBinding %i %w") && Geometry_matchBindingTypeStr(fr[2].getStr(),vertexAttribBinding))
{
int unit=0;
fr[1].getInt(unit);
@@ -323,7 +323,7 @@ bool Geometry_readLocalData(Object& obj, Input& fr)
iteratorAdvanced = true;
}
if (fr.matchSequence("VertexAttribNormalize %i %s"))
if (fr.matchSequence("VertexAttribNormalize %i %w"))
{
int unit=0;
fr[1].getInt(unit);