Hi Mark, If you have slave Camera's doing the actual rendering then your master camera's callbacks won't be called as the master camera won't be doing anything - it's just a passive object providing overall settings.
As Paul mentions potentially we could add the inheritance of the master Camera's callbacks down to the slaves, so it'd hide this difference. The callbacks would be called multiple times and from several threads at once so would need to be able to handle this - it wouldn't be able to assume single threaded, single view. Robert. On Mon, Nov 30, 2009 at 8:54 PM, Mark Jones <[email protected]> wrote: > In main() I have: > [code] > viewer.setSceneData( rootNode ); > osg::Camera *pCamera = viewer.getCamera(); > > //osg::Image* image = new osg::Image; > //image->allocateImage(tex_width, tex_height, 1, GL_RGBA, > GL_UNSIGNED_BYTE); > //image->allocateImage(tex_width, tex_height, 1, GL_RGBA, GL_FLOAT); > > // attach the image so its copied on each frame. > //pCamera->attach(osg::Camera::COLOR_BUFFER, image, samples, > colorSamples); > pCamera->setFinalDrawCallback(new MyCameraPostDrawCallback(NULL)); > > return viewer.run(); > [/code] > and in RenderStage::draw() is the code > [code] > // render all the post draw callbacks > drawPostRenderStages(renderInfo,previous); > > if (_camera && _camera->getFinalDrawCallback()) > { > // if we have a camera with a final callback invoke it. > (*(_camera->getFinalDrawCallback()))(renderInfo); > } > > // pop the render stages camera. > if (_camera) renderInfo.popCamera(); > } > [/code] > > When my code is running, the pointer to camera in main is nothing like the > _camera in the RenderStage, meaning that my callback never happens. > > When I breakpoint in RenderStage (the only place I found FinalDrawCallback > used) the camera I put the callback on isn't one of those cameras. Why? > > I'm on a dual screen setup and I find 2 cameras (where the camera pointer is > different) which makes me think there might be something going on there. > > I'm using a modified version of osgprerender.cpp as the base for what I am > doing at the moment. > > I'm using other cameras for textures with callbacks in another part of the > program just fine, so the fact that this callback doesn't happen seems > strange. > > _______________________________________________ > 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

