Hello michael,

 The setUpCamera does not run since the camera has the previous
RenderStage as a cached object for efficiency issues. If you change the
attachment, you should set the camera cache to NULL, then when the
rendering occurs, a new RenderStage will be created for the camera and
the runCameraSetup will be called again.

 But... if you change the attachment every frame, I guess it will be
very slow. If that's the case I'd would recommend you change locally
your code for the camera and RenderStage to directly change the
RenderStage attachments without creating it each frame.

 

Good luck,

 Guy. 

 

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Guerrero, Michael (CIV)
Sent: Thursday, April 10, 2008 1:24 AM
To: OpenSceneGraph Users
Subject: [osg-users] runCameraSetUp not called after attaching new
images to the camera

 

Hi guys, I'm not sure if this is a bug or I'm not understanding
something.  The first time I attach images to a camera, the
runCameraSetUp function will be called in RenderStage which sets up the
fbo to harvest the data.

 

I do the following:

 

texCam->attach(osg::Camera::COLOR_BUFFER, mReferenceColorImage);

texCam->attach(osg::Camera::DEPTH_BUFFER, mReferenceDepthImage);

 

This works just fine.  The problem is when I want to change the images
that are attached.  For instance I later have the following:

 

texCam->attach(osg::Camera::COLOR_BUFFER, mSceneColorImage);

texCam->attach(osg::Camera::DEPTH_BUFFER, mSceneDepthImage);   

 

After setting the attachments to new images, runCameraSetUp will never
get called to set up the frame buffer object.  Is there something I can
do to make this happen?

 

Thanks,

Michael Guerrero

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to