Hello, I've been wracking my brain all day on trying to figure out how to do this with no clear examples found online.
I have this set of calls in my C++: mGroupState = mBoundGeometry->getOrCreateStateSet(); mGroupState->getOrCreateUniform("BaseTexSampler", osg::Uniform::SAMPLER_2D)->set(mBaseColor); mGroupState->getOrCreateUniform("BaseWeight", osg::Uniform::FLOAT)->set(mBaseWeight); mGroupState->setTextureAttributeAndModes(BASE_TEXTURE_UNIT, mBaseColor, osg::StateAttribute::ON); I've bound this base texture to texture unit (BASE_TEXTURE_UNIT = 1). Later in the code, I have this in another function if I create another layer with another texture: mGroupState->getOrCreateUniform("TexLayerSampler0", osg::Uniform::SAMPLER_2D)->set(tex); mGroupState->setTextureAttribute(BASE_TEXTURE_UNIT + 1, tex, osg::StateAttribute::ON); Where I've created a second texture and want it to reside in texture unit 2. However, in my shader code when indexing the TexLayerSampler0, I only get base texture. finalColor = texture(TexLayerSampler0, LayeredTexCoords[0].st); Which is wrong. I'm stil trying to figure out OpenGL and how it works along with OSG so sorry for the inexperience. -M ---------------------------------------- Marlin Rowley Software Engineer, Staff [cid:image002.jpg@01D39374.DEC5A2E0] Missiles and Fire Control 972-603-1931 (office) 214-926-0622 (mobile) marlin.r.row...@lmco.com<mailto:marlin.r.row...@lmco.com>
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org