Stereo viewing using quad buffers in JOGL

I am encountering problems enabling stereo viewing in JOGL. We have nVidia NV35GL [Quadro FX 3000] cards, and are running Linux. I try to enable stereo in JOGL using the following:
GLCapabilities capabilities = new GLCapabilities();
capabilities.setStereo(true);
canvas = GLDrawableFactory.getFactory().createGLCanvas(capabilities);

On machines without quad buffer support, this code fails. On machines with quad buffers, it succeeds. However, in the latter case, the program then encounters an exception: “unable to make context current”. Omitting the call to setStereo() removes this exception.

I would be interested in hearing from anyone else in the community who has had experience with enabling stereo viewing in JOGL. Any sample code that successfully achieves this would be very welcome.

I was able to get stereo on a Nvidia Quadro 3000g using the same code that you have. Although I haven’t been working on that project much, and it has been several months since I have run it in stereo mode, so something could have broken in the latest releases. This was using redhat 9 linux with a 2.6 kernel.

Can’t help you much on the Linux side right now, but quad buffers is working fine on our 3DLabs cards here (various versions of the Wildcat VP series).

Are you letting AWT set the redraw priority or are you clocking it yourself? That may be the problem. If you could post a stack trace to the exception that would help a lot in guessing what the problem is.

Not sure how helpful… but this is a ‘me too’ for ATI cards, using dual output passive stereo.

Thanks for the replies. In the meantime I have found an alternative method for displaying the stereo images, using the “twin monitor” capability of the nVidia driver. Here’s how it works:

In the system XConfig file I set up the graphics device as follows:
Section “Device”
BoardName “Quadro FX 3000”
BusID “1:0:0”
Driver “nvidia”
Identifier “Device[0]”
Screen 0
Option “DPMS” “off”
#The following five lines are important for setting up “twin” mode
Option “TwinView”
Option “SecondMonitorHorizSync” “31-75”
Option “SecondMonitorVertRefresh” “60”
Option “TwinViewOrientation” “LeftOf”
Option “MetaModes” “1280x1024, 1280x1024”

Option “Rotate” “off”
VendorName “NVidia”

for passive stereo:

Option “ConnectedMonitor” “CRT,CRT”
EndSection

Then, I create a GLCanvas and put it into a frame, which I then set to be a fullscreen window. Because of the way the configuration is set up, this has the size 2560x1024. In my rendering loop, I draw the right and left eye views into the the left and right halves, resp., of the drawing buffer (which has the size 2560x1024) (using glViewport(1280,0,1280, 1024) and glViewport(0,0,1280,1024), not glDrawBuffer(GL_LEFT_BACK) and glDrawBuffer(GL_RIGHT_BACK)).

Note: the same procedure works fine to generate “classical” crosseyed stereo pairs, where the left half of the window contains a view for the right eye and the right half contains the left eye view. For this reason, the option “TwinViewOrientation” is set to “LeftOf”, since the second monitor (corresponding to the viewport (1280,0,1280,1024) contains the left-eye view, not, as you might expect, the right.

This solution works fine, and has the advantage that full-screen anti-aliasing works with it, where with the driver that we have installed, quad buffers does NOT work with full-screen anti-aliasing. (I don’t know whether the latest Linux drivers from nVidia released end of June, correct this bug).

I can post details if anyone is interested.