Re: [osg-users] osgscreencapture sample doesn't work

2010-12-01 Thread Robert Osfield
HI Ignore,

I have just tried the command line you supplied and it worked
correctly on my Kubuntu 10.10/ATI system.

The errors you are seeing suggest an issue with the OpenGL driver.
What hardware and drivers are you using?

Robert.

On Wed, Dec 1, 2010 at 12:10 PM, Igor Galochkin  wrote:
> Hi,
>
> I am trying to render the scene to an image without opening any windows. 
> After doing a lot of searching and looking thru source code of OSG classes, I 
> still get a completely white image.
>
> In many places people say one should use the same code as there is in 
> osgscreencapture which renders to a pbuffer is --pbuffer-only option is 
> passed.
>
> But the fact is that osgscreencapture doesn't work itself!
>
> osgscreencapture.exe axes.osg --pbuffer-only 640 480
>
> must produce an image without opening any windows.
>
> When running this on my laptop (WindowsXP home) i get the following error 
> message:
> PixelBufferWin32::init(), Error: Couldn't find a suitable pixel format
> Pixel buffer has not been created successfully.
> Windows Error #2000: Win32WindowingSystem::OpenGLContext() - Unable to 
> restore current OpenGL rendering context. Reason: Pixel format is invalid.
>
> after that the axes.osg file is just opened in a full-screen viwer window, no 
> image file is created.
>
>
> When running this on my Desktop PC (WindowsXP Pro) i get the following error 
> message:
> Pixel buffer has been created successfully.
> PixelBufferWin32::makeCurrentImplementation, wglMakeCurrent error: Die 
> angeforderte Ressource wird bereits verwendet. (The requested resource is 
> already being used)
>
> Error: OpenGL version test failed, requires valid graphics context.
> After that the program crashes and attempt to open Visual Studio debugger.
>
> On both machines OSG is correctly installed, e.g. i can easily open the osg 
> files in viewer by double clicking.
>
> Do I at least call the osgscreenviewer correctly?
>
>
> ...
>
> Thank you!
>
> Cheers,
> Igor
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=34307#34307
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgscreencapture sample doesn't work

2010-12-01 Thread Jean-Sébastien Guay

Hello Igor,


In many places people say one should use the same code as there is in 
osgscreencapture which renders to a pbuffer is --pbuffer-only option is passed.
But the fact is that osgscreencapture doesn't work itself!

osgscreencapture.exe axes.osg --pbuffer-only 640 480


In another thread we established that there was a problem with using 
pbuffers on Windows in a multithreaded app. The call to viewer.realize() 
eventually calls makeCurrent on the context, which makes the context 
current for the main thread, and then when the GraphicsThread tries to 
call makeCurrent in its own thread it fails with the "The requested 
resource is in use" message.


I have just submitted a fix. A workaround is to add this after 
viewer.realize():


viewer.stopThreading();
gc->releaseContext();
viewer.startThreading();

As for your laptop, I think it just doesn't support pbuffers. Check if 
it supports the WGL_ARB_pbuffer extension (you can see the supported 
extensions by setting OSG_NOTIFY_LEVEL=DEBUG and running osgviewer 
cow.osg, they will be printed near the start of the output when the 
context is created).


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgscreencapture sample doesn't work

2010-12-02 Thread Igor Galochkin
Thanks a lot, guys!
Yesterday i though i'd go mad, it was like hitting the head against a wall.. 
 But yes, i checked out the current subversion tomorrow morning and managed to 
write an image successfully under Windows with osgscreencapture.
Now it should be (hopefully) trivial to use it in my project.

Thanks for help and for the fix!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34408#34408





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org