Linda, Any chance of a typo??
Looks like you intended the second image file to be the same as the first - test1.bmp - except that the first letter is missing. PhilT -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Linda Lee Sent: 11 June 2011 09:48 To: [email protected] Subject: Re: [osg-users] Passing multiple textures in glsl Hi, I tried add these lines into my code: osg::Texture2DArray* tileImgLay; tileImgLay = new osg::Texture2DArray; tileImgLay->setTextureSize(128, 128, 2); tileImgLay->setUseHardwareMipMapGeneration(false); tileImgLay->setImage(0, osgDB::readImageFile("test1.bmp")); tileImgLay->setImage(1, osgDB::readImageFile("est1.bmp")); ss->setTextureAttribute(1, tileImgLay); tileImgLay->setFilter( osg::Texture2DArray::MIN_FILTER, osg::Texture2DArray::NEAREST); tileImgLay->setFilter( osg::Texture2DArray::MAG_FILTER, osg::Texture2DArray::NEAREST); ss->addUniform( new osg::Uniform("test", 1) ); and in the fragment shader: uniform sampler2DArray test; and access it using: gl_FragColor = texture2DArray(test, vec3(0, 0, 0)); However, it fail to work. Any ideal why? Thank you! Cheers, Linda ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40370#40370 _______________________________________________ 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

