Added support for setting texture units in the new TexGenNode.

This commit is contained in:
Robert Osfield
2004-06-17 14:02:15 +00:00
parent 840d5d4930
commit 06aa06d686
7 changed files with 56 additions and 25 deletions

View File

@@ -883,7 +883,7 @@ void CullVisitor::apply(TexGenNode& node)
RefMatrix& matrix = getModelViewMatrix();
addPositionedAttribute(&matrix,node.getTexGen());
addPositionedTextureAttribute(node.getTextureUnit(), &matrix,node.getTexGen());
handle_cull_callbacks_and_traverse(node);

View File

@@ -56,4 +56,27 @@ void RenderStageLighting::draw(osg::State& state,RenderLeaf*& previous)
}
for(TexUnitAttrMatrixListMap::iterator titr=_texAttrListMap.begin();
titr!=_texAttrListMap.end();
++titr)
{
state.setActiveTextureUnit(titr->first);
AttrMatrixList attrList = titr->second;
for(AttrMatrixList::iterator litr=attrList.begin();
litr!=attrList.end();
++litr)
{
state.applyModelViewMatrix((*litr).second.get());
// apply the light source.
litr->first->apply(state);
// tell state about.
state.haveAppliedTextureAttribute(titr->first, litr->first);
}
}
}