Hi Robert, I also tried what you suggest without result :( Is there a way to test if the frame buffer attachment failed ? In the update callback I bind tex A (or B on odd frames) to Dummy group 0's state set, attach tex B (or A) to the RTT cam color attachment, and bind tex B (or A) to Dummy group 1's state set. I only get a yellow object on even frames and get the original tex A map on odd frames, as if the RTT cam color attachment never gets binded with tex A...
My subgraph looks like this: this (osg::Group), has the update callback /\ / \ / \ RTT cam \ | \ | Dummy group 1 (Second Branch Shader: Readback texture written to and output) | \ | Scene | Dummy group 0 (First Branch Shader: Output yellow) | | Scene Pass 1 ======================== 1st branch: Binding texture 0x6cbdb0 to unit 2 Attaching texture 0x6cc230 to camera color buffer 2nd branch: Binding texture 0x6cc230 to unit 3 Pass 2 ======================== 1st branch: Binding texture 0x6cc230 to unit 2 Attaching texture 0x6cbdb0 to camera color buffer 2nd branch: Binding texture 0x6cbdb0 to unit 3 Pass 3 ======================== 1st branch: Binding texture 0x6cbdb0 to unit 2 Attaching texture 0x6cc230 to camera color buffer 2nd branch: Binding texture 0x6cc230 to unit 3 [...] Bill -----Original Message----- From: [EMAIL PROTECTED] on behalf of Robert Osfield Sent: Sun 4/22/2007 5:41 AM To: osg users Subject: Re: [osg-users] Camera attachments 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 > osg-users@openscenegraph.net > http://openscenegraph.net/mailman/listinfo/osg-users > http://www.openscenegraph.org/ > _______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/
<<winmail.dat>>
_______________________________________________ osg-users mailing list osg-users@openscenegraph.net http://openscenegraph.net/mailman/listinfo/osg-users http://www.openscenegraph.org/