display / anaglyphic problem

Hi everybody.

i have a little problem with my anaglyph program. i am writing a program that should be able
to display a scene anaglyphic. the scene is described in a source, that shouldn’t be changed,
so i have to catch the commands and replaced them with my own api with little changed commands.

the first time, swapBuffers is called, the scene should be rendered into the accumulation buffer
with the left eye’s colorMask. I do that with glAccum(GL_LOAD, 1.0);
By now, there shouldn’t be something in the frame buffer.
The next time, swapBuffers is called, the scene should be added to the accumulation buffer with
the right eye’s colorMask and a little camera translation. I do that with glAccum(GL_ACCUM,1.0);
Now the accumulation buffer should be copied into the frame buffer and be displayed
glAccum(GL_RETURN, 1.0);

I want the scene only displayed, when both renders are in the accumulation buffer, not when only
one is in it. But in my program there is alternately displayed the left eye’s scene, and then
the complete scene.

the scene shouldn’t be displayed, when only the left eye (the first turn) is loaded into the
accumulation buffer. i should be displayed, when both views are in the accumulation buffer.
is it possible to prevent opengl from displaying this frame?
i hope i made my problem clear!?

First you don’t need accum. color channels are different, you just need proper color mask.
Second you only need one swapbuffers, once both images have been drawn.

For this task you can use the color buffer directly without the accum.

Thank you guys for your replies!

I’ll make some tests without using the accumulation buffer. i was doing something in this direction some time ago, but that didn’t work then (i think mostly because i made some mistakes in programming). but i’ll try that out.

But another point is, i want to do some operations in the color buffer as well. like adding a certain value to rgb. This is to make viewing through anaglyph glasses not to cause headache after some time.
There are some formulas for this, and i thought the accumulation buffer is also a good way to implement this, too. Because you also have some possibilities with the accum buffer to change the values with some very easy commands.

Are there some other commands to easily add a value to the rgb values in the color buffer, without using the accum buffer?

It’s easily :slight_smile:

glEnable (GL_BLEND);
glBlendFunc (GL_ONE, GL_ONE);

You also can disable the depth test.

-Racoon

Originally posted by raoulduke:
But another point is, i want to do some operations in the color buffer as well. like adding a certain value to rgb. This is to make viewing through anaglyph glasses not to cause headache after some time.
There are some formulas for this, and i thought the accumulation buffer is also a good way to implement this, too.

Do you have some pointers for these formulas?