Hi All,
I'm trying to get Texture2DArrays working, but am having some trouble. My
textures always show up black. I'm setting up the texture array as follows
ref_ptr<Texture2DArray> textureArray = new Texture2DArray;
textureArray->setTextureDepth(1);
Image* image = osgDB::readImageFile("media/skymap.tga");
textureArray->setImage(0, image);
stateSet->setTextureAttribute(0, textureArray.get(),
osg::StateAttribute::ON);
and trying to read it in the shader.
#version 120
#extension GL_EXT_gpu_shader4 : enable
uniform sampler2DArray rainTextures;
void main()
{
gl_FragColor = texture2DArray(rainTextures, vec3(gl_TexCoord[0].st, 0));
}
Now, if I switch out the Texture2DArray with a normal Texture2D (and update the
shader accordingly) it shows up fine, which leads me to believe the rest of the
app is working. I'm pretty new to OSG and so am wondering if I missed
something obvious with the setup of the Texture2DArray. Thanks!
-Sean
_________________________________________________________________
Shed those extra pounds with MSN and The Biggest Loser!
http://biggestloser.msn.com/_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org