PDA

View Full Version : Anaglyphs without color mask and without GLSL



stepasite
03-12-2014, 08:57 AM
I would like to develop customizable anaglyph application so that colors can be tuned by users. It means that using glColorMask() will not be sufficient for such purpose.

I would also like to avoid GLSL. Is it even possible? Yes, I know about this thread:

http://www.opengl.org/discussion_boards/showthread.php/172991-Anaglyphs-without-glColorMask?highlight=anaglyphs

but I could not find any answer to my question in it.

Here is what I tried:



glClearColor(0.0,0.0,0.0,0.0);
glClearDepth(1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// set camera for left eye
// draw scene

glClear(GL_DEPTH_BUFFER_BIT);
glBlendFunc(GL_ONE, GL_ONE);
glEnable(GL_BLEND);
// set camera for right eye
// draw scene


The above unfortunately does not work. Setting glBlendFunc(GL_ONE, GL_ONE) causes that right image is not rendered correctly and all pixels (no matter how far they are from camera) are blended into resulting image.

Does exist any workaround for this? Any help would be much appreciated. Thanks in advance for any help.