I first tried the beginner forum with no success. /me thought that maybe Gurus could help :-) :
I have made a stereo application with two different algorithms: toe-in and off-axis.
I can also cycle through Toe-in, Off-axis and
However in non stereo mode the app slows down
(it looks like the same view of the scene is rendered 2 times)...
Here is a bit of my code:
// s_3D is a just an abstraction layer
// the following line is a bit complex but basically it is the same as if '(stereoActive)'
if (((SimpleSetting<bool> *) Settings::getInstance()->getSetting(Settings::STEREO))->getValue())
// LEFT EYE
// Render the scene
// I had to add following line because left and right buffers are shared (Nvidia quadro, before we had a 3DLabs oxygen which worked fine without).
// RIGHT EYE
// Render the scene
getStudio().action(); // place the camera which is between LEFT_EYE and RIGHT_EYE positions
// render the scene
The clearAllBuffers is :
// We select back buffer so that nicely written opengl drivers should clear
// right and left buffer when in stereo mode at the same time.
if (((SimpleSetting<bool> *) Settings::getInstance()->getSetting(Settings::SHADOWS))->getValue()
| | ((SimpleSetting<bool> *) Settings::getInstance()->getSetting(Settings::REFLECTIONS))->getValue()
| | ((SimpleSetting<bool> *) Settings::getInstance()->getSetting(Settings::HALOS))->getValue())
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
initBackbuffer is :
glDrawBuffer( GL_BACK );
I feel like it might be because of initBackBuffer ?! If stereo mode is enable maybe I should select either left or right back buffer and not GL_BACK ???
--- recent Addition
Well, I tried to change the call (in initBackBuffer) to select the left back buffer, and then animation went smooth.
Unfortunelately, doing so is not enough because the right buffer is of course black, so animation is flickering scene/black/scene/black...).
If after drawing in the left back buffer, I draw in the right back buffer (without changing the point of view), animation is smooth and there is no more flickering but as slow as in stereo (which is logic).
My very first try was to select the back buffer (GL_BACK) and draw once the scene, and call swap buffer but in that case animation is choppy (which is strange)...
What I would like is to be able to get a smooth animation and ALSO an increase in FPS when switching to non-stereo rendering in my stereo enabled app...