Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7
Hi Everyone, Big Thanks to Farshid for the solution :-) Support for his workaround, to use Copy as a swap Method, was recently included in OSG trunk. SwapCopy is not active by default - people not using Aero should be still happy with default SwapExchange. These who would like to activate the SwapCopy method can use environment variables or osgViewer command line arguments ( provided they use Viewer( ArgumentParser ) ctor ). env var method: set OSG_SWAP_METHOD=COPY command line method: osgviewer --swap-method COPY Inside the code one can select swap method for a particular window via GraphicsContext::Traits or for all windows by changing the default set in DisplaySettings. Traits default to method set in DisplaySettings. DisplaySettings use whats set by env var or command line. If no option is given DEFAULT is used. I hope such solution is fairly complete and covers all possible use cases. All 4 allowed swap method options are: SWAP_EXCHANGE - flip back front buffers SWAP_COPY - copy contents of back buffer into front buffer SWAP_UNDEFINED - move contents of back buffer into front buffer, leaving back buffer contents undefined SWAP_DEFAULT - let the driver select the method (in my observation NVidia drivers on Win7 defaults to EXCHANGE) Cheers, Wojtek Lewandowski From: Wojciech Lewandowski Sent: Monday, September 27, 2010 2:31 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi, I have submitted code changes. Look at osg-submissions for details. Wojtek Lewandowski From: Wojciech Lewandowski Sent: Friday, September 24, 2010 9:44 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi, Exactly as Farshid Said I have modified PreparePixelFormatSpecification function in GraphicsWindowWin32.cpp to test the workaround. Interestingly PreparePixelFormatSpecification has a input allowSwapExchangeARB parameter as if someone had similar problem before. But this parameter is used when function is called but not influenced directly by GraphicContext::Traits. In my opinion the best option would be expose Swap method in the GraphicContext::Traits. I may try to come up with a patch on monday. Anyone to beat me on this ;-) ? Wojtek From: Farshid Lashkari Sent: Friday, September 24, 2010 6:40 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi Robert, On Fri, Sep 24, 2010 at 9:28 AM, Robert Osfield robert.osfi...@gmail.com wrote: Did you modify the OSG to achieve this? If so could you post the changes. Perhaps this could be made as an runtime option in osgViewer. My application handles all the windowing code itself, so I didn't need to make any changes to OSG. I noticed that GraphicsWindowWin32.cpp hard codes the swap method to WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would be ideal, however I'm not very familiar with osgViewer, so I'm probably not the best person to make this change, otherwise I would have already submitted a patch ;) Cheers, Farshid ___ 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 ___ 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] Workaround for nVidia + fullscreen + Windows 7
Hi, I have submitted code changes. Look at osg-submissions for details. Wojtek Lewandowski From: Wojciech Lewandowski Sent: Friday, September 24, 2010 9:44 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi, Exactly as Farshid Said I have modified PreparePixelFormatSpecification function in GraphicsWindowWin32.cpp to test the workaround. Interestingly PreparePixelFormatSpecification has a input allowSwapExchangeARB parameter as if someone had similar problem before. But this parameter is used when function is called but not influenced directly by GraphicContext::Traits. In my opinion the best option would be expose Swap method in the GraphicContext::Traits. I may try to come up with a patch on monday. Anyone to beat me on this ;-) ? Wojtek From: Farshid Lashkari Sent: Friday, September 24, 2010 6:40 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi Robert, On Fri, Sep 24, 2010 at 9:28 AM, Robert Osfield robert.osfi...@gmail.com wrote: Did you modify the OSG to achieve this? If so could you post the changes. Perhaps this could be made as an runtime option in osgViewer. My application handles all the windowing code itself, so I didn't need to make any changes to OSG. I noticed that GraphicsWindowWin32.cpp hard codes the swap method to WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would be ideal, however I'm not very familiar with osgViewer, so I'm probably not the best person to make this change, otherwise I would have already submitted a patch ;) Cheers, Farshid ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Workaround for nVidia + fullscreen + Windows 7
Hi, Wojtek suggested I create a separate thread for this, so here it is. I've also been experiencing the fullscreen issue with nVidia cards on Windows 7. Just wanted to let you know that I found a workaround. When creating the OpenGL context, I changed the swap method from WGL_SWAP_EXCHANGE_ARB to WGL_SWAP_COPY_ARB. This completely solved the issue for me. Others have reported that this fixed the issue for them as well. Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7
Hi Farshid, On Fri, Sep 24, 2010 at 4:24 PM, Farshid Lashkari fla...@gmail.com wrote: Wojtek suggested I create a separate thread for this, so here it is. I've also been experiencing the fullscreen issue with nVidia cards on Windows 7. Just wanted to let you know that I found a workaround. When creating the OpenGL context, I changed the swap method from WGL_SWAP_EXCHANGE_ARB to WGL_SWAP_COPY_ARB. This completely solved the issue for me. Others have reported that this fixed the issue for them as well. Did you modify the OSG to achieve this? If so could you post the changes. Perhaps this could be made as an runtime option in osgViewer. Thanks, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7
Hi Robert, On Fri, Sep 24, 2010 at 9:28 AM, Robert Osfield robert.osfi...@gmail.comwrote: Did you modify the OSG to achieve this? If so could you post the changes. Perhaps this could be made as an runtime option in osgViewer. My application handles all the windowing code itself, so I didn't need to make any changes to OSG. I noticed that GraphicsWindowWin32.cpp hard codes the swap method to WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would be ideal, however I'm not very familiar with osgViewer, so I'm probably not the best person to make this change, otherwise I would have already submitted a patch ;) Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7
On 9/24/2010 10:40 AM, Farshid Lashkari wrote: I noticed that GraphicsWindowWin32.cpp hard codes the swap method to WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would be ideal, however I'm not very familiar with osgViewer, so I'm probably not the best person to make this change, otherwise I would have already submitted a patch ;) At least at one time in the past, SWAP_COPY performed slower than SWAP_EXCHANGE (because it does a copy, duh). I don't know if this is relevant anymore. Cheers, Farshid -- Chris 'Xenon' Hanson, omo sanza lettere Xenon AlphaPixel.com PixelSense Landsat processing now available! http://www.alphapixel.com/demos/ There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7
Hi, Exactly as Farshid Said I have modified PreparePixelFormatSpecification function in GraphicsWindowWin32.cpp to test the workaround. Interestingly PreparePixelFormatSpecification has a input allowSwapExchangeARB parameter as if someone had similar problem before. But this parameter is used when function is called but not influenced directly by GraphicContext::Traits. In my opinion the best option would be expose Swap method in the GraphicContext::Traits. I may try to come up with a patch on monday. Anyone to beat me on this ;-) ? Wojtek From: Farshid Lashkari Sent: Friday, September 24, 2010 6:40 PM To: OpenSceneGraph Users Subject: Re: [osg-users] Workaround for nVidia + fullscreen + Windows 7 Hi Robert, On Fri, Sep 24, 2010 at 9:28 AM, Robert Osfield robert.osfi...@gmail.com wrote: Did you modify the OSG to achieve this? If so could you post the changes. Perhaps this could be made as an runtime option in osgViewer. My application handles all the windowing code itself, so I didn't need to make any changes to OSG. I noticed that GraphicsWindowWin32.cpp hard codes the swap method to WGL_SWAP_EXCHANGE_ARB. To apply this workaround the users would just need to change this to WGL_SWAP_COPY_ARB and recompile. Having this configurable would be ideal, however I'm not very familiar with osgViewer, so I'm probably not the best person to make this change, otherwise I would have already submitted a patch ;) Cheers, Farshid ___ 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