Hi,

I use a Texture2DArray in my application.

All objects are rendered using shaders, and most of them use the 
TextureSampler2DArray data.

So I made a top object in my scene graph, and I assign to its StateSet :

- a uniform (SAMPLER2DArray) with the Texture2DArray unit number
- the Texture2DArray

This top object doesn't have any geometry, it's only to store a "common" 
stateset.

And, thanks to stateset inheritance, all my objects shaders receive the uniform 
and the Texture2dArray binding.

Everything works well if I bind the Texture2DArray  to unit 0 or unit 1, but if 
I bind it to unit 2, 3, 4... the texture data are not binded (I saw that in 
gDebugger : texture unit is not binded)

I need to bind it to unit 2 because some of my objects models use unit 0 and 
unit 1 for regular textures.

Is there any reason for this problem ?
How can I fix it ?

My hardware : Quadro 4800 FX - Windows 7
My code :


Code:
p_root->getOrCreateStateSet()->setTextureAttribute(2, p_textureArray, 
osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE);



(I tried with "setTextureAttributeAndModes", it doesn't work, and according to 
this post : http://forum.openscenegraph.org/viewtopic.php?t=5237&highlight= I 
think I should use "setTextureAttribute")

Thank you!

Cheers,
Aurelien

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=45308#45308





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to