Opened 21 months ago

Closed 21 months ago

Last modified 21 months ago

#15434 closed defect (fixed)

Patch for NVidia 3DVision stereo support on non quadro cards

Reported by: Markus Owned by:
Priority: low Milestone: 3.0.0
Component: OpenGL Version: stable-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes


NVidia have opened up for full screen applications to run in stereo on Windows using a NVidia Geforce 200 series or later. That is, a quadro card is not needed.

This does not work with current implementation of full screen mode for wxWidgets.
Supplied a patch to allow for this. The problem seems to be that the fullscreen mode of wxWidgets does not use WS_POPUP. Adding WS_POPUP for full screen mode (if requested) is the only way I could find to get the stereo mode for NVidia 3D Vision to trigger.

The patch contains documentation as well as a modified opengl cube sample. Note however that the cube have to rotate for the 3DVision to be triggered. I assume it has to do with some need for concurrent calls to OnPaint before the NVidia drivers trigger stereo mode.

To test both the problem and the fix a computer with Windows 7 (I think) and NVidia Geforce 200 series or above and a 3D Vision ready monitor (1920x1080 at 120 Hz) is needed.

Until this is fixed we will need to use a modified version of wxWidgets for Windows.
Of course I take no offense if you want to change the names of the new style for fullscreen that I added or if you figure out some nicer way to integrate this change with wxWidgets.

Not sure if I should label this as defect or enhancement since I assume it might be a quite rare use case (OpenGL, fullscreen, stereo).

Attachments (2)

Nvidia3DVisionSupport.patch download (4.9 KB) - added by Markus 21 months ago.
Nvidia3DVisionSupport_1.0.patch download (8.6 KB) - added by Markus 21 months ago.
An updated version of the previous patch. As discussed in the messages. This one contains a better example.

Download all attachments as: .zip

Change History (11)

Changed 21 months ago by Markus

comment:1 Changed 21 months ago by vadz

  • Priority changed from normal to low
  • Status changed from new to confirmed

Thanks for the patch, unfortunately I can't test it myself but I could probably apply it blindly as it doesn't change anything by default anyhow.

Still, I have two questions:

  • Would there be any harm in always using WS_POPUP in full screen? I think we could just always use if wxFULLSCREEN_NOBORDER and wxFULLSCREEN_NOCAPTION are specified. And I'd prefer to avoid adding another wxFULLSCREEN_XXX constant if possible.
  • Can we somehow detect if 3D support is available to allow the sample to use it in this case? As it stands, very few people will think to edit the sample code to enable your changes, probably, so it would be nice to make them more visible/discoverable.

comment:2 Changed 21 months ago by Markus


Thank you for your fast answer. Regarding your questions.

  1. The problem with adding WS_POPUP seems to be that it disables the possibility of having dialogs rendered correctly in full screen. Dialogs seems to become invisible but they still respond to mouse input (hovering mouse over them will change the mouse pointer and clicking where they were seems to grab mouse events. I think WS_POPUP is intended to not let any dialogs be rendered on top. Hence the reason I did not want to change the default. You can test this behavior on your system without stereo setting. It behaves like that in our application but I did not modify any wxWidgets samples to show this effect though so I am not 110% sure.
  1. Well... We have one detection for that in our system (which is open source and you can look at it if you want to). It is basically a hack and not fool proof. We get the GL_VENDOR and GL_RENDERER strings from the graphics card and check for "nvidia" and !"quadro" strings.

comment:3 Changed 21 months ago by vadz

First point is surprising, dialogs always use WS_POPUP and we can show nested dialogs so I don't understand at all why would it work differently in this case.

About second point, I just really don't know enough. If your hack works in practice, it would be nice to have it. If not, perhaps we could just have a menu item "Toggle stereo" in the sample allowing to enable it manually?

comment:4 Changed 21 months ago by Markus

I don't understand the WS_POPUP behavior either. I guess it could be the OpenGL combination or somesuch. Or perhaps we are doing something wrong in our system. I will modify the rsample to see if I can reproduce the issue in fullscreen on my system. Since I assume your sample is the way-to-do-OpenGL. If I can't reproduce it there then I guess WS_POPUP could always be used.

I think "Toggle stereo" menu would probably be good. If the first point still stands I will add the "nvidia"/"quadro" check when stereo is being toggled.

I will not be able to do this until later this week due to other priorities.

comment:5 Changed 21 months ago by Markus

It seems like the issue is not the dialogs themselves but rather something with the NVidia 3DVision drivers and how they work.
I can modify the sample to show a dialog on top of the window. The dialog is however only shown as long as the stereo rendering is not triggered. When the stereo rendering is triggered (through some Alt+Tabbing to force it) the dialog disappears and I can't get it to show anymore as long as stereo is being rendered.

On Quadro cards the dialogs show up just fine, no matter if WS_POPUP is added or not. They do however, in fullscreen mode, for some reason cause one of the stereo buffers to freeze up a bit at the last rendered frame before the dialog was shown.

Concerning dialogs and full screen stereo, a dialog should not be there unless it is needed for debugging-purposes simply because it breaks the stereo illusion quite well.

So the end result is, yes put in WS_POPUP as default for full screen, no need for the extra wxWidgets constant. We just need to make sure that there is some documentation about the missing dialogs if nvidia stereo is desired on a non-quadro card. Where do you suppose I should write this??

I will add a new patched that simply adds WS_POPUP and use a better version of the cube example.

Changed 21 months ago by Markus

An updated version of the previous patch. As discussed in the messages. This one contains a better example.

comment:6 Changed 21 months ago by Markus

Sorry about the spamming. I forgot to add that the new patch is again revision 74723 of trunk.

comment:7 Changed 21 months ago by vadz

  • Milestone set to 3.0

Thanks, I'm fine with applying this and will do it but I'd still feel better if somebody else could test this first. Please do if you can and leave a note here, TIA!

comment:8 Changed 21 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [74818]) Show full screen windows with WS_POPUP style in wxMSW.

This doesn't make any difference for most windows but fixes a problem with
wxGLCanvas windows using stereo support of Nvidia cards and generally it does
make sense to use WS_POPUP with full screen windows as they are definitely not
overlapped, so just use this style unconditionally.

Closes #15434.

comment:9 Changed 21 months ago by VZ

(In [74819]) Add code showing stereo support to the OpenGL cube sample.

Show how WX_GL_STEREO attribute can be used, if available.

See #15434.

Note: See TracTickets for help on using tickets.