[osg-users] Camera weirdness
pmartz at skew-matrix.com
Mon Nov 30 13:42:58 PST 2009
My guess would be that your camera callback isn't inheriting to the
slave cameras, sort of like the problem I recently encountered (and
fixed) relating to the clear mask (see the thread "Problem with
Camera::inheritCullSettings" from about a week ago). You might need to
submit a similar fix.
Skew Matrix Software LLC
+1 303 859 9466
Mark Jones wrote:
> In main() I have:
> viewer.setSceneData( rootNode );
> osg::Camera *pCamera = viewer.getCamera();
> //osg::Image* image = new osg::Image;
> //image->allocateImage(tex_width, tex_height, 1, GL_RGBA,
> //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,
> pCamera->setFinalDrawCallback(new MyCameraPostDrawCallback(NULL));
> return viewer.run();
> and in RenderStage::draw() is the code
> // render all the post draw callbacks
> if (_camera && _camera->getFinalDrawCallback())
> // if we have a camera with a final callback invoke it.
> // pop the render stages camera.
> if (_camera) renderInfo.popCamera();
> 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
> osg-users mailing list
> osg-users at lists.openscenegraph.org
More information about the osg-users