Page 1 of 5 12345 LastLast
Results 1 to 10 of 47

Thread: How to generate stereo manually

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    15

    How to generate stereo manually

    Hi
    I started learning OpenGL. I worked myself thru the "Beginning OpenGL Game Programming second edition" book.
    I think it is a great source for learning OpenGL 3.

    My goal is to generate a 3D world which is rendered in stereo.
    I have the nVidia GTS250 and the 3D Vision shutter glasses.

    3D Vision is capable of displaying scenes in stereo while they are not developped that way. So it probably overrides the (mono) rendering and makes the second view (stereo) automatically for you.

    I would like to develop some application that does stereo rendering manually. So that I have complete control over it.

    So I quess I have to use quad buffer mode. But how can I make this work on the nVidia shutter glasses? How can I make the shutter glasses sync to the monitor? I do not want nVidia makes this stereo automatically, so should I remove the nVidia 3D Vision driver stuff?

    Do I also have to tune my grafics card using RivaTuner? Or is this card capable of doing the quad buffer mode?

    I would be very happy if some one could show me a program example how to do that. Prefereable without using Glut.

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,654

    Re: How to generate stereo manually

    Quote Originally Posted by melomania
    My goal is to generate a 3D world which is rendered in stereo. I have the nVidia GTS250 and the 3D Vision shutter glasses. ... So I quess I have to use quad buffer mode.
    Historically, I think quad-buffered stereo has been Quadro-only. In the NVidia driver README, it's pretty explicit about quad-buffered stereo being Quadro only. So if the docs are correct, that shouldn't work on your GTS250.

    However, while I thought I'd heard and read that the true 3D shutter glasses stereo solution (aka "NVidia 3D Vision", in contrast to "NVidia 3D Vision Discover" which is just cheap red/blue anaglyph glasses), was locked to Quadros only. For instance:

    * 3D Vision Overview (NVidia)

    However, here:

    * NVidia GTS250

    it says it supports "full NVidia 3D Vision", whatever marketing decided that means.

    So who knows. I'm not impressed with how unclear the information is out there on NVidia's 3D Vision support.

    If you don't get some great info here, I suggest you try http://forums.nvidia.com or http://developer.nvidia.com/forums. The former has an explicit forum for the 3D Vision stuff (NVIDIA Forums > nZone > Hardware > GeForce 3D Vision).

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    15

    Re: How to generate stereo manually

    The 3D Vision shutter glasses do work with the GS250 card. No problem.
    But the question is if I can use the quad buffer mechanisme when programming manually using OpenGL.
    Or is that for Quadro cards only?

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Oct 2004
    Posts
    4,654

    Re: How to generate stereo manually

    Quote Originally Posted by melomania
    But the question is if I can use the quad buffer mechanisme when programming manually using OpenGL.
    Or is that for Quadro cards only?
    From the README for the recent NVidia driver I have installed here on Linux:

    Option "Stereo" "integer"

    Enable offering of quad-buffered stereo visuals on Quadro.
    ...
    Stereo is only available on Quadro cards.
    But given how inconsistent their 3D Vision/stereo info is, I suggest you ask NVidia on their forums.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Aug 2007
    Location
    Adelaide, South Australia
    Posts
    208

    Re: How to generate stereo manually

    Quote Originally Posted by Dark Photon
    Historically, I think quad-buffered stereo has been Quadro-only.
    I used to have an ASUS GeForce 3 that was quad buffered sterio and came with LCD shutter glasses.
    It suffered from ghost images due to the LCD not going fully black fast enough, and the lenses were heavily tinted to make the flickering less noticable, but that just made everything too dark.
    The technology at the time just wasn't good enough so they stopped making the 3D versions of their GeForce cards.

    Quad buffered sterio is part of the OpenGL standard and is very simple to impliment (Just switch between 4 different buffer pointers at VSYNC instead of 2) so the only reason for it not to work on a GTS250 is if the NVIDIA marketing department decided it wanted to force people who want 3D to buy a more expensive card.

    The ASUS card had a socket for the 3D glasses on the backplate next to the VGA socket, but before that there were homebrew devices controlled from the computers parallel port that seemed to work with any graphics card.

  6. #6
    Senior Member Regular Contributor
    Join Date
    Aug 2007
    Location
    Adelaide, South Australia
    Posts
    208

    Re: How to generate stereo manually

    Quote Originally Posted by melomania
    I quess I have to use quad buffer mode. But how can I make this work on the nVidia shutter glasses? How can I make the shutter glasses sync to the monitor? I do not want nVidia makes this stereo automatically, so should I remove the nVidia 3D Vision driver stuff?
    I would be very happy if some one could show me a program example how to do that. Prefereable without using Glut.
    The standard NVIDIA driver does not offer stereo pixel formats, so you probably need to keep the 3D vision driver.

    Do the following to find out if stereo is supported in OpenGL(assuming your using windows):
    Setup a PixelFormatDescriptor structure, setting the PFD_STEREO flag in addition to the usual OpenGL flags as follows:
    {#NOTE# This is in pascal, but you should be able to convert it to whatever language you are using, or just set the individual fields in your code}
    Code :
    var
      PFD: PixelFormatDescriptor = (
        nSize: sizeof(PixelFormatDescriptor); {Size}
        nVersion: 1;  {version}
        dwFlags: PFD_Draw_To_Window + PFD_Support_OpenGL + PFD_DoubleBuffer + PFD_STEREO; {Flags}
        iPixelType: PFD_Type_RGBA; {Color Mode}
        cColorBits: 32; {Color buffer}
        cDepthBits: 24 ); {Depth buffer}
    In the code we now ask windows to find the closest matching pixelformat (ChoosePixelFormat), set it (SetPixelFormat), then use DescribePixelFormat to see what it actually gave us:
    Code :
      PixelFormatID := ChoosePixelFormat( DeviceContext, @PFD ); 
      if PixelFormatID = 0 then RaiseLastOSError;                
      if not SetPixelFormat( DeviceContext, PixelFormatID, @PFD ) then RaiseLastOSError;
      MaxPixFormat := DescribePixelFormat( DeviceContext, PixelFormatID, SizeOf(PIXELFORMATDESCRIPTOR), PFD );
    If the PFD_STEREO bit is still set then you have a quad buffered framebuffer and can call glDrawBuffer(BACK_LEFT) to draw the left eye image and glDrawBuffer(BACK_RIGHT) to draw the right eye image.

  7. #7
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    15

    Re: How to generate stereo manually

    It seems that I can set the PFD_STEREO flag. After the ChoosePixelFormat and SetPixelFormat calls, the flag is still set.
    But when I call glDrawBuffer(GL_BACK_RIGHT) I get an GL_INVALID_OPERATION error code.
    When calling glDrawBuffer(GL_BACK_LEFT) I get no error code.

    The complete render code is:\
    Code :
    void Example::render()
    {
    	GLuint error = GL_NO_ERROR;
     
    	error = glGetError();
    	glDrawBuffer(GL_BACK_LEFT);
    	error = glGetError();
     
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glLoadIdentity();
     
        glRotatef(2*m_rotationAngle, 0, 0, 1);
     
    	glBegin(GL_TRIANGLES);
    		glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
    	    glVertex3f(-1.0f, -0.5f, -4.0f);
    		glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
    		glVertex3f(1.0f, -0.5f, -4.0f);
    		glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
    		glVertex3f(0.0f,  0.5f, -4.0f);
    	glEnd();
     
    	error = glGetError();
    	glDrawBuffer(GL_BACK_RIGHT);
    	error = glGetError();
     
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
        glLoadIdentity();
     
        glRotatef(m_rotationAngle, 0, 0, 1);
     
    	glBegin(GL_TRIANGLES);
    		glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
    	    glVertex3f(-1.0f, -0.5f, -4.0f);
    		glColor4f(1.0f, 1.0f, 0.0f, 1.0f);
    		glVertex3f(1.0f, -0.5f, -4.0f);
    		glColor4f(0.0f, 0.0f, 1.0f, 1.0f);
    		glVertex3f(0.0f,  0.5f, -4.0f);
    	glEnd();
     
    }

    I try to draw a triangle for the left buffer and then an other one (different angle) for the right one. But I always only get the second one on screen.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Dec 2007
    Posts
    258

    Re: How to generate stereo manually

    quad buffer is essentially dead since support for it was killed in vista

  9. #9
    Junior Member Newbie
    Join Date
    Nov 2009
    Posts
    15

    Re: How to generate stereo manually

    Quote Originally Posted by dukey
    quad buffer is essentially dead since support for it was killed in vista
    dead????
    Do you mean that the nVidia Vista driver implementation of OpenGL does not support it? And is this the same for Windows 7?
    But nVidia sells this 3D Vision package.

  10. #10
    Senior Member Regular Contributor
    Join Date
    Aug 2007
    Location
    Adelaide, South Australia
    Posts
    208

    Re: How to generate stereo manually

    After the ChoosePixelFormat and SetPixelFormat calls, the flag is still set.
    Neither of these write to the PFD structure, you must use DescribePixelFormat before checking the PFD to see the flags (and other settings) of the pixel format that ChoosePixelFormat returned.

    Are you using full-screen or a window? The NVIDIA site says that 3D is currently only supported for full-screen contexts.
    Do you have the latest versions of both drivers? The early versions were difficult to get working.
    Have you tried different NVIDIA control-panel settings for 3D?

    NVIDIA 3D is supposed to be supported on XP, Vista and 7.
    It is however possible that they have deliberately disabled direct access to the 3D buffers by OpenGL programs on the GeForce cards for marketing reasons (so they can sell more of the expensive Quadro's).
    A quick search of NVIDIA's site found several articles on what does and doesn't work, each of which completely disagreed with what any of the others said.

Page 1 of 5 12345 LastLast

Similar Threads

  1. Manually generate mipmaps for textures loaded using glCompressedTexImage2D
    By imported_Silverlan in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-19-2014, 06:20 PM
  2. How to temporary disable stereo in stereo mode ?
    By lekeno in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 10-02-2003, 01:54 AM
  3. Replies: 1
    Last Post: 09-26-2003, 05:20 AM
  4. GF3: My app in stereo w Nvidias 3D Stereo Driver
    By fritzlang in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 03-26-2002, 12:20 PM
  5. Manually loading GL DLL
    By BwB in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-30-2000, 04:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean