Hi,

I'm having a crash with setTextureAttributeAndModes I don't know how to fix. 

To explain the issue. I have a list of data sets which hold a pointer to a 
osg::Texture3D. The texture mixing is done in a shader and my texture update 
function containing the following loop is called from an update  callback. 
Since the order of the textures can/must change i loop over the textures and do 
this


Code:

osg::StateSet* sliceState = m_sliceNode->getOrCreateStateSet();
for ( size_t i = 0; i < datasetList.size(); ++i)
{
          osg::Texture3D* texture3D = datasetList[i] )->getTexture3D();
          sliceState->setTextureAttributeAndModes( i, texture3D, 
osg::StateAttribute::ON );
}




This works just find when adding one texture after another. However when the 
order changes, thus overwriting a different order it crashes. So apparently I'm 
doing it wrong. 

Any help would be greatly appreciated.
... 

Thank you!

Cheers,
Otto

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=18753#18753





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to