[vtk-developers] Buggy non-stereo rendering on a stereo capable window

Thierry.CARRARD at CEA.FR Thierry.CARRARD at CEA.FR
Thu Dec 13 04:42:30 EST 2007


Hi all,

The following test case produces flickering image on stereo capable
machines (i.e. with a Quadro board) :

renwin->StereoCapableWindowOn()
renwin->StereoRenderOff()
assuming that renwin is an OpenGL render window

This is due to drawing to GL_BACK_LEFT buffer only instead of GL_BACK
(which in stereo mode duplicates written pixels to GL_BACK_LEFT *AND*
GL_BACK_RIGHT buffers).

This is due to the initialisation of the BackBuffer member of
vtkOpenGLRenderWindow to GL_BACK_LEFT.

Moreover, this is incoherent with the rest of vtkOpenGLRenderWindow.cxx
in which, in the SetPixels method, we explicitly call
glDrawBuffer(GL_BACK).


My guess for a solution is the following:

1. ensure that every call to glDrawBuffer in all VTK sources uses
renwin->GetBackBuffer() (or GetFrontBuffer) as its argument.

2. ensure that the BackBuffer (resp. FrontBuffer) member of
vtkOpenGLRenderWindow is always equal to GL_BACK (resp. GL_FRONT)
whenever renwin->GetStereoRender() is false. Otherwise (when stereo
render is on), ensure that BackBuffer (resp. FrontBuffer) is always
equal to either GL_BACK_LEFT or GL_BACK_RIGHT (resp. GL_FRONT_LEFT or
GL_FRONT_RIGHT).


PS: check
http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/
drawbuffer.html for details.


Best regards,
Thierry.



More information about the vtk-developers mailing list