Hi,

Does anybody successfully ran the osgscreencapture example on Windows
when passing e.g. --pbuffer 1280 1024 cessna.osg as arguments? With
such arguments, you render both in a P-Buffer and a viewer window. But
I'm recording the following error in the console:


Pixel buffer has been created successfully.
Windows Error #2000: Win32WindowingSystem::OpenGLContext() - Unable to restore c
urrent OpenGL rendering context. Reason: The pixel format is invalid.

Select GL_BGRA read back format
Window size 1280, 1024
Reading window usig glReadPixels, with a double buffer PixelBufferObject.
Allocating image
Generating pbo 0
Generating pbo 2
fps = 60.256, full frame copy = 2.9919ms rate = 438.09 Mpixel/sec, 1671.2 Mb/sec
 time for memcpy = 2.4892ms  memcpy speed = 2008.6 Mb/sec
fps = 59.804, full frame copy = 2.9196ms rate = 448.93 Mpixel/sec, 1712.5 Mb/sec
 time for memcpy = 2.4642ms  memcpy speed = 2029 Mb/sec
Press any key to continue...


Please note that this issue only surfaces when rendering both in a
P-Buffer and a viewer window. There's no problem when passing
--pbuffer-only 1280 1024 cessna.osg (rendering in P-Buffer only, no
viewer window) or simply cessna.osg (rendering in viewer window only).

I've tracked down the problem to line 716:

    pbuffer = osg::GraphicsContext::createGraphicsContext(traits.get());

It's noteworthy that pbuffer is valid, as alluded to earlier in the
console logs.

It's a different issue than the one reported in
http://forum.openscenegraph.org/viewtopic.php?t=7214. There,
multithreading problems were triggering the same error, but with
--pbuffer-only, whereas I've no problem with this configuration. I've
nevertheless tried the proposed workarounds, without a success.

I've also looked at the osgautocapture example, but there's no
scenario leading to render both in a P-Buffer and a viewer window, so
now invalid pixel format error there. However, I don't understand how
the following test (line 233) can be true:

    if (viewer.getCamera()->getGraphicsContext() &&
viewer.getCamera()->getGraphicsContext()->getTraits()) {

When rendering in a P-Buffer,
viewer.getCamera()->getGraphicsContext()->getTraits() always returns
NULL on my system.

Any thought?

Thanks,

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

Reply via email to