Maxime BOUCHER wrote on Thursday, July 30, 2009 8:24 AM:

> Hi,
> 
>  I'm looking for reloading the texture I send to a shader I put on the
top of
>  the scene graph. As every geode/drawable (it depends on the model) as
a
> different texture, I'd like to reload the good one for each. 
> 
>  I tried to do so using the geodes' & drawables' update callbacks in
the
> callbacks example but it always takes the last geode/drawable 's
visited
> texture.  
> 
>  As the FFP does it, I'm pretty sure I can too.
> Do you know how?

The shader has a sampler2D uniform that needs to be set to the texture
unit you want to use; as long as you attach a different Texture2D to
each geode/drawable on that texture unit, the shader will see that
geode/drawable's texture.

You only need update callbacks if the texture changes from frame to
frame.

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

Reply via email to