Hi Robert,
 
Yes, I can do that if I have an own camera to do the RTT. This particular case 
is about a node that will modify any camera that renders it. 
 
I assumed that I had stumbled over a bug in OSG when I discovered that turning 
off RTT does not work.
 
 
More explanation about why I am doing it this way:
 
I have a node that will modify any camera that actually targets the node for 
rendering.
The node will put any current render camera into RTT mode, and have post-render 
cameras as children that will post-process the result. I can thus add it to any 
scene-graph and get the post-processing I want without having to alter the 
scene-graph any further.
Doing it with a new RTT camera means that I have to add it as a slave camera to 
every camera that renders the scene-graph, or to add it as a child camera of 
any camera that renders the scene-graph. A child camera would have to be 
inserted so that it severs the connection between old camera and scene-graph 
(to prevent the old camera to render the scene-graph itself). A slave camera 
would be complicated if the main camera already has a lot of slaves.
The simulators we are creating will be used on a high variety of setups, it can 
be one camera or it can be 100 cameras. A generic solution is to make a node 
that modifies the current camera instead of inserting new cameras. 
Doing it this way is so far proving to be a benefit, except for the fact that I 
can not turn off the RTT mode.
 
Viggo
> Date: Wed, 13 Aug 2008 13:50:16 +0100> From: [EMAIL PROTECTED]> To: 
> [email protected]> Subject: Re: [osg-users] Help! I have a 
> render target problem.> > Hi Viggo,> > To switch off RTT rendering just node 
> camera->setNodeMask(0x0);> > Robert.> > On Wed, Aug 13, 2008 at 11:32 AM, 
> Viggo Løvli <[EMAIL PROTECTED]> wrote:> > Hi,> >> > I am setting up my camera 
> to render to a texture with the following> > commands:> >> > 
> camera.setRenderTargetImplementation( osg::Camera::FRAME_BUFFER_OBJECT> > );> 
> > camera.attach( osg::Camera::BufferComponent( osg::Camera::COLORBUFFER0> > 
> ), myBuffer );> > camera.setDrawBuffer( GL_COLOR_ATTACHMENT0_EXT );> >> > The 
> camera now renders to the texture myBuffer which is a> > 
> osg::TextureRectangle*.> > After many ticks, I decide to stop rendering to 
> the texture, so I run the> > following commands:> >> > camera.detach( 
> osg::Camera::BufferComponent( osg::Camera::COLORBUFFER0 )> > );> > 
> camera.setDrawBuffer( GL_NONE );> > camera.setReadBuffer( GL_NONE );> > 
> camera.setRenderTargetImplementation( osg::Camera::FRAME_BUFFER );> >> > I do 
> not delete the myBuffer pointer.> > I continue to read from myBuffer even 
> though I do not write to it anymore.> >> > PROBLEM: The program continues to 
> the myBuffer texture, and not to the> > frame-buffer.> >> > Regards,> > 
> Viggo> >> >> > ________________________________> > Windows Live Messenger på 
> mobilen. Hold kontakten hvor som helst når som> > helst.> > 
> _______________________________________________> > 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
_________________________________________________________________
Få Windows Live Messenger på mobilen.
http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-no&ocid=30032
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to