Hi Hailong, The OSG itself places no restriction on the number of texture units, but some OpenGL drivers can do, particularly for the fixed function pipeline, perhaps you are hitting up against this. I know that NVIdia have recently reduced the number of texture units they support using the fixed function pipeline.
Robert. On 21 January 2014 14:37, Hailong FU <[email protected]> wrote: > Hi, > > Right now I am texturing a digital surface model using many (more than 4) > airborne images, for example I want to texture the 6 facades of a building. > I am using OSG to do the meshing and texturing. However, I found one object > can only show the first 4 image textures, the 5th 6th won't show up. What's > the problem when I use more than 4 texture units for one geometry? Could you > give some hint please? > > > osg::ref_ptr<osg::StateSet> stateOne = new osg::StateSet(); > stateOne->setDataVariance(osg::Object::DYNAMIC); > > for(int i=0; i< imgs; i++) > > { > osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D; > texture->setDataVariance(osg::Object::DYNAMIC); > > texture->setImage(img[i]); > > texture->setWrap(osg::Texture::WRAP_S,osg::Texture::CLAMP_TO_BORDER); > texture->setWrap(osg::Texture::WRAP_T,osg::Texture::CLAMP_TO_BORDER); > texture->setWrap(osg::Texture::WRAP_R,osg::Texture::CLAMP_TO_BORDER); > texture->setBorderColor(osg::Vec4d(1,1,1,0)); > > osg::ref_ptr<osg::TexEnv> texenv = new osg::TexEnv; > texenv->setMode(osg::TexEnv::MODULATE); > > stateOne->setTextureAttribute(i,texenv,osg::StateAttribute::ON); > > texture->setInternalFormatMode(osg::Texture::USE_IMAGE_DATA_FORMAT); > texture->setResizeNonPowerOfTwoHint(1); > > stateOne->setTextureAttributeAndModes(i,texture,osg::StateAttribute::ON); > > } > > geode->getDrawable(0)->setStateSet(stateOne); > ... > > Thank you! > > Cheers, > Hailong > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=57945#57945 > > > > > > _______________________________________________ > 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

