I’m trying to do quad-buffered stereo on a nVidia Quadro under Windows XP, but it doesn’t seem to be working. I’m drawing a test pattern with red on the GL_LEFT buffer and cyan on the GL_RIGHT buffer, and the program works perfectly in C++ (my stereo glasses connected to the system trigger or if I turn them off, the image it appears on the screen as white). In JOGL, if I do the GLCapabilities.setStereo(false), the program just draws the pattern red (I draw GL_LEFT second). But if I turn stereo on, the program either raises an exception (if I run it on a computer without the quadro card), or only draws the cyan side (if I use the quad-buffered card). Has anyone else got quad-buffered stereo to work properly? And if so, can I see an example of the code to be sure I’m not missing something?
Please post the Exception stacktrace
The problem isn’t in the exception… I know why that’s happening - the GeForce doesn’t support stereo mode. I’m just using that to show that the stereo mode is being turned on (i.e. I know what I’m doing in the code) on the Quadro card.
Since this post, I’ve tried a few other things… I changed a setting in the quadro driver (“force stereo shuttering” to on), and now the stereo glasses trigger when I start the program(although, they do with all openGL programs), but in a GLJPanel, one of the eyes shows what it should be showing, and the other is blank (i.e. an empty canvas). on a GLCanvas, meanwhile, I get an exception when I call g.drawBuffer(GL_RIGHT). Here’s the exception for THAT error with GLDebug in the pipeline… Also note that I get this same error if I call GL.BACK…
Exception in thread “AWT-EventQueue-0” javax.media.opengl.GLException: javax.media.opengl.GLException: glGetError() returned the following error codes after a call to glDrawBuffer(): GL_INVALID_OPERATION
at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:275)
at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:245)
at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
at sun.awt.RepaintArea.paint(RepaintArea.java:224)
at sun.awt.windows.WComponentPeer.handleEvent(WComponentPeer.java:254)
at java.awt.Component.dispatchEventImpl(Component.java:4031)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
So where is the underlying implementation for implementing stereo (at least, in win XP), anyway? I can’t seem to figure out where the “under-the-hood” part is that enables stereo in the impl package…
Look in WindowsGLDrawable.java, specifically in glCapabilities2PFD (which is probably the code path you’re going down) or glCapabilities2iattributes. In both cases the stereo flag simply causes a bit to be set in the pixel format capabilities / attributes.
JOGL hasn’t undergone a lot of testing with stereo but the last time I tried it with the NVidia stereeo drivers on a GeForce FX 5800 Ultra it worked properly.