Hi ???,
Could you please provide some name so we can address you?
You can try to set the texture mode to override:
setTextureAttributeAndModes(1, texture, osg::StateAttribute::ON |
osg::StateAttribute::OVERRIDE);
This won't work if any of the texture states is set to protected however.
A clean approach would use a visitor to replace the existing texture
state attribute with your desired texture.
Cheers
Sebastian
Hi, all!
The problem confused me these days, but I can not figure out. Pls help.
1. I load a scene from the ive file:
osg::Node* scene = osgDB::readNodeFile("qlsc.ive");
2. then, I attach the scene to a group node: grp->addChild(scene);
3. I set a texture attributes to the group node:
grp->getOrCreateStateset()->setTextureAttributeAndModes(1, texture, osg::StateAttribute::ON);
//texture is an osg::Texture2D object.
however , when I show the scene in a viewer, the scene is tetured
with its original texture in the "ive" file.
the problem is why the texture unit in the child node is not replaced
by the parent node's texture unit???
Thanks for your attention!
------------------------------------------------------------------------
[email protected]
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org