Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 OpenSceneGraph,我如何使用它GL_REPLACE来渲染我的纹理?我不希望我的纹理颜色随着方向而改变。我还希望渲染的颜色与纹理的值相匹配。
GL_REPLACE
在包含纹理的 Geode 上(可能还有它上面的任何节点,只要你不覆盖它),你可以这样做:
osg::TexEnv* pTexEnv = new osg::TexEnv(); pTexEnv->setMode(osg::TexEnv::REPLACE); pGeode->getOrCreateStateSet()->setTextureAttributeAndModes(0, pTexEnv, osg::StateAttribute::ON);
现在纹理将完全用它自己的颜色绘制。