Hi Bill,

You need to change the textures on the FBO's and StateSet's, swaping
pointers locally will just swap pointers locally and have no effect on
the objects you want to control.

Robert.

On 4/20/07, Poirier, Guillaume <[EMAIL PROTECTED]> wrote:




Hello all,


 First of all, I apologize if this question was discussed already... I am
searching for my questions on
 the email archive
(http://openscenegraph.org/archiver/osg-users/) and it
looks like the search function
 only returns old stuff. I remember reading a mail about this issue but I
can't remember what the conclusion
 was...

 Now my question... I have an update callback on a group node that swaps
input / render to textures at each
 frame. Basically I render to a texture (FBO attachment) and use this
texture on an object in my scene.
 The values in the texture need to be accumulated, thus the swapping part.
After doing some tests it looks
 like the write to texture only works on even frames, i.e. with the texture
it was first attached to
 (texture B).

 // update callback
 virtual void operator() (osg::Node* node, osg::NodeVisitor* nv)
 {
    Swap A and B textures if not first frame

    Set texture A as input to subgraph quad branch

    Attach texture B as camera color buffer

    Set texture B as input to subgraph scene branch
 };

 I am not sure about the swap texture part. I just swap the texture pointers
like
 osg::Texture2D *tempTex = TexA.get();
 TexA = TexB.get();
 TexB = tempTex;

 The texture are the same size and have the same attribute. I also tried to
add a RTT cam post
 draw callback to detach the color buffer but without success...

 Any help or pointer to a previous thread would be appreciated :)


 bill

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to