(note: for some reason my email reader did not receive your latest message from
this thread, and therfore to quote I had to paste from
http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-June/012825.html)
Robert, to answer your questions--
-- Yes, all the windows are on screen at the same time;
-- They are rendering the same scene graph, but each window has a different
camera view into the scene;
-- Due to the architecture of the overall larger application that our OSG codes
are linked with, we can not use one onscreen window.
I did test our OSG-based codes with osg::Camera::FRAME_BUFFER_OBJECT, on
another Windows XP box that has a NVIDIA Quadro FX 3000, and saw the same
results. Unfortunately our application is also running C#, and a Windows COM
server at the same time, so we can not test on Linux or UNIX.
I have not tried testing osg::Camera::PIXEL_BUFFER_RTT on the Quadro FX 3000,
since osg::Camera::FRAME_BUFFER_OBJECT does work on the Quadro FX 5600 and
should suffice for us.
And some follow-up questions:
a) Should the rendering be showing up in each window when
osg::Camera::FRAME_BUFFER_OBJECT is enabled?
b) Is there a simple/easy way to take the image data that is rendered, i.e. the
fboImage from my code snippet below, and write those pixels into the window's
framebuffer, so that we see the rendering?
For example, osg::Image::readPixels() reads pixels from the current frame
buffer at specified position and size, using glReadPixels.
I don't see an equivalent glDrawPixels() methods?
c) Is it possible to intermix OSG calls and OpenGL calls?
For example, can I call the appropriate glPushXXX/glPopXXX functions, with a
glDrawPixels() in between to show my data?
d) Is it possible to re-structure our scene graph with a switch node as the
root, to get my desired effect: the switch would have two children, one child a
camera with osg::Camera::FRAME_BUFFER and the other child is a camera that has
osg::Camera::FRAME_BUFFER_OBJECT?
I was hoping I could switch between the children when I wanted to see the
rendered view on screen, but this did not work. I was getting confused with the
master/slave cameras on osg::View and the cameras that I was adding as children
to the osg::Switch, so I am probably doing something wrong...
-Jon.
[osg-users] osg::Camera::FRAME_BUFFER_OBJECT, on-screen windows not reflecting
rendered image
Robert Osfield robert.osfield at gmail.com
Mon Jun 16 08:05:14 PDT 2008
* Previous message: [osg-users] osg::Camera::FRAME_BUFFER_OBJECT, on-screen
windows not reflecting rendered image
* Next message: [osg-users] Implementing OcclusionQueryNode?
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Jon,
Do you have all these windows on screen at one time? Are they all
rendering the same view and scene graph? Is it possible to use one
onscreen window and muiltiple FBOs?
As a sanity test please try other hardware/OpenGL drivers and if
possible OSs, as if this is driver problem they it's best to know
early on so you can then know what to do about workarounds.
Robert.
On Mon, Jun 16, 2008 at 3:31 PM, Goldman, Jon <jgoldma at sandia.gov> wrote:
> Hi Robert,
>
> In our application we open several windows, on the order of 10 at a time. In
> each window we render a viewpoint into the scene. Then we capture each window
> individually and send each video image frame from each window down the
> network. Incidentally we use Unreal Streaming Technologies
> (http://www.umediaserver.net/index.html) media server products for that part.
>
> What is happening is that either because we have so many windows, or because
> of operating system windows (this all runs on Windows XP) being displayed on
> the screen, when one window overlaps another, it corrupts that part of the
> image. So basically we want to fix that problem. Make sense?
>
> As I wrote, using the osg::Camera::FRAME_BUFFER_OBJECT render implementation
> mostly works, except that the on-screen window has garbage in it. We want to
> be able to see the on-screen window for debugging and
> "proof-the-system-is-working", especially once we deliver the system to our
> customer.
>
> -Jon
>
>
> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org [mailto:osg-users-bounces
> at lists.openscenegraph.org] On Behalf Of Robert Osfield
> Sent: Monday, June 16, 2008 3:07 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] osg::Camera::FRAME_BUFFER_OBJECT, on-screen windows
> not reflecting rendered image
>
> Hi Jon,
>
> I can't work out exactly what you are trying to achieve with your
> render "offscreen". So could you please from a high level explain
> what effect you are trying to achieve.
>
> Robert.
>
> On Fri, Jun 13, 2008 at 1:07 AM, Goldman, Jon <jgoldma at sandia.gov> wrote:
>> Hi,
>>
>> I am somewhat new to OpenSceneGraph. For my project we need to render
>> "offscreen" -- so that overlapping windows do not corrupt the rendered
>> image. We are using osg::Camera::FRAME_BUFFER_OBJECT render implementation,
>> and getting the core behaviour we want, which is to say that we can extract
>> the correctly rendered pixels from the image attached to the camera/frame
>> buffer object.
>>
>> However, I still have two issues, and a question on performance:
>>
>> 1) The on-screen window is not showing the rendered image. Instead it is
>> filled with garbage (or black) pixels. The question is what is the best way
>> to reflect the contents of the fbo image? Should we do as osgprerender
>> example does and create some geometry (osg::Geometry) and then texturemap
>> the image onto the surface, or is there another (better?) way to push the
>> pixels into the framebuffer so that the on-screen window displays properly?
>>
>> 2) using osg::Camera::PIXEL_BUFFER_RTT render implementation crashes on our
>> system. We are running 32-bit Windows XP with dual SLI-graphics NVIDIA 5600
>> cards. I didn't spend a lot of time on this problem, mainly wondering if
>> others are seeing the same?
>>
>> 3) Question: Any recommendation(s) on ways to increase/maximize performance
>> when using fbo?
>>
>>
>> Here is a code snippet showing how we are currently setting up the fbo:
>>
>> .
>> .
>> .
>> osg::Image * fboImage = new osgImage();
>> fboImage->allocateImage( width, height, 1, GL_RGB, GL_UNSIGNED_BYTE);
>>
>> wc->cameraPostRenderCB = new WindowCapturePostDrawCallback(wc->getView(),
>> fboImage, NULL);
>>
>> // attach the image so it's copied on each frame.
>>
>> theCamera->attach( osg::Camera::COLOR_BUFFER, fboImage);
>>
>> osg::Camera::RenderTargetImplementation renderImplementation;
>> renderImplementation = osg::Camera::FRAME_BUFFER_OBJECT;
>>
>> // tell the camera to use OpenGL frame buffer object where supported.
>> theCamera->setRenderTargetImplementation(renderImplementation);
>>
>> // set the post render callback
>> theCamera->setPostDrawCallback(wc->cameraPostRenderCB);
>> .
>> .
>> .
>>
>>
>> Thanks,
>> -Jon Goldman
>> Sandia National Laboratories
>> Albuquerque, New Mexico
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
* Previous message: [osg-users] osg::Camera::FRAME_BUFFER_OBJECT, on-screen
windows not reflecting rendered image
* Next message: [osg-users] Implementing OcclusionQueryNode?
* Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the osg-users mailing list
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org