Paul,

I think what Steve is trying to figure out is a way to run his shader without 
stepping on any existing textures loaded for a particular model.  

Steven - I don't know, but there might be a more generalized way to get the 
number of in-use textures for a scenegraph / node.  My thought was that you can 
run a visitor after loading in your models to determine how many textures are 
used.  Then you can set your shaders to 2 available ones.  Or pick high numbers 
(6,7) that have a high probability of not being used.

Chuck


On Aug 23, 2010, at 12:09 PM, Paul Martz wrote:

> Steven Powers wrote:
>> In practice, I'm creating 2 textures and storing shader relevant data in 
>> them.
>> I'm assigning them to the state set using setTextureAttributeAndModes(1,...) 
>> and setTextureAttributeAndModes(2,...) but some objects in the scene must 
>> also have textures defined for these texture units. 
> 
> Are you also setting up corresponding sampler uniforms?
> 
>> This causes an override of the data I've assigned to texture unit 1 and 2. 
>> Is there a way to keep this from happening?
> 
> If some higher-level parent node assigns a texture to unit 1, and somewhere 
> in a subgraph, another node assigns a different texture to unit 1, then by 
> default the child subgraph's texture gets used. You can change this behavior, 
> to some extent, by specifying the OVERRIDE mode when you set the higher-level 
> parent node's texture StateAttribute.
> 
> Aspects of state inheritance are well-documented in the Quick Start Guide.
>   -Paul
> 
> _______________________________________________
> 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

Reply via email to