With OpenSceneGraph, how do I make it use GL_REPLACE
to render my texture?
I do not want the color of my texture to change with orientation.
I also want the rendered color to match the values of the texture.
Asked
Active
Viewed 459 times
0

Bart
- 19,692
- 7
- 68
- 77
1 Answers
1
On the Geode that contains the texture (and probably any node above it, as long as you don't override it), you can do this:
osg::TexEnv* pTexEnv = new osg::TexEnv();
pTexEnv->setMode(osg::TexEnv::REPLACE);
pGeode->getOrCreateStateSet()->setTextureAttributeAndModes(0, pTexEnv, osg::StateAttribute::ON);
Now the texture will be drawn with exactly it's own color.

Solx
- 4,611
- 5
- 26
- 29