On 7/22/2011 10:09 AM, Fred Maulir wrote:
> Great advice. Do you mean than I can I retrieve the modified texture through 
> a getUniform call after the update() call ?

  Not through getUniform, but you can retrieve the modified texture after 
rendering
completes. I'm trying to remember which example might show this. If you don't 
even care to
see the onscreen data, look at the osgscreencapture example. It renders to a 
texture and
then grabs that texture as an image and writes it to disk,

> In fact I'll have about 200 objects that I need to know if each of them have 
> been lit or not.
> Do you think I can do a 15*15 texture and associate one pixel with each 
> object ?

  Yes. Also, with the non-power-of-two texture extensions, you could make a 
20x10 or even
200x1 texture just fine.

> Thus how can I retrieve a custom value in pixel shader that we'll indicate me 
> which is the index of the current object on which the shader is applied to ?

  Stick a Uniform on each object called ObjectID and set it to a number in the 
range of
[0,199].

-- 
Chris 'Xenon' Hanson, omo sanza lettere. [email protected] 
http://www.alphapixel.com/
  Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. 
Contracting.
    "There is no Truth. There is only Perception. To Perceive is to Exist." - 
Xen
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to