Hi John,

The difference is small, but it can cause problems.  The post draw
callback is executed after the cameras scenegraph is rendered, but
before any POST_RENDER camera nodes in the graph are rendered.
POST_RENDER camera nodes are commonly used for 2D displays (i.e. HUD
displays).  If you are trying to capture a HUD with the post draw
callback, it won't work.  However, it should work for anything that is
not inside a POST_RENDER camera.  Robert added the final draw callback
shortly after the OSG2.2 release after this issue was discovered.  The
final draw callback is called after everything in the scenegraph
(including POST_RENDER cameras) is rendered.  If you are trying to do
screen captures, I would definitely use the final draw callback.

 

Also, what arguments are you passing to the image::readPixels call?  You
will have to pass the x, y, width, and height values from the camera
viewport to this method.

 

-Justin

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Argentieri, John-P63223
Sent: Wednesday, June 18, 2008 4:10 PM
To: [EMAIL PROTECTED]
Subject: Re: [osg-users] osgViewer Custom Graphics Operations

 

Justin,

 

I tried the exact same thing as this, but I did a setPostDrawCallback
instead of setFinalDrawCallback. Do you think that could make the
difference? We are doing all sorts of things with OSG that might
interfere.

 

John

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Vican,
Justin E.
Sent: Wednesday, June 18, 2008 4:06 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgViewer Custom Graphics Operations

Hi John,

I don't know what else you are trying to do, but as far as screen
capturing goes, it is supported by the composite viewer.  It is not
explicitly supported by the osgViewer:CompositeViewer class, but it can
be done through a derived osg::Camera::DrawCallback.  The callback can
be added to each osg::Camera in the osgViewer::CompositeViewer through
the osg::Camera::setFinalDrawCallback() method.

 

Hope this helps,

Justin

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Argentieri, John-P63223
Sent: Wednesday, June 18, 2008 3:37 PM
To: [EMAIL PROTECTED]
Subject: [osg-users] osgViewer Custom Graphics Operations

 

Robert/OSG, 

What is the plan for OSG to grant us the ability to insert custom
graphics operations in a controlled order? What I mean is, what if we
want to process our own application-level callbacks immediately after
makeCurrent() and immediately before swapBuffers() using
osgViewer::CompositeViewer?

There are too many things that we can't do using
osgViewer::CompositeViewer and Camera/Cull callbacks. 

osgViewer::CompositeViewer doesn't permit us to do image->readPixels in
order to do a screen capture. I've read all your advice on the topic in
this forum. It just doesn't work.

We have to roll our own render loop to the point that I never even call
renderTraversals(). I made my own method that substitutes that method.
Of course, I don't have access to the barriers, so my viewer must be
single threaded.

John Argentieri 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to