I need front-to-back compositing functionality and my first intuition was to simply use
as blending parameters.
A blank screen leads to the idea, that the color buffer could be only RGB. But
unsigned char bMode; glGetBooleanv(GL_RGBA_MODE, &bMode);
results in ONE, so I decided to have a closer look into the buffer. Then I noticed, that the alpha channel was everywhere ONE, so rendering an object with the above blending function must of course result in (0,0,0,0). So clearing the buffer with (0,0,0,0) before drawing should make a rendered object visible exactly with it’s color and alpha values, doesn’t it?
Finally I observed, that clearing the buffer actually doesn’t clear it
// get (back) buffer
// and clear it
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
// just to be sure…
// have a closer look at some region of the buffer
glReadPixels(100, 100, 10, 10, GL_RGBA, GL_FLOAT, pMem);
Now I’m completely confused…
Who can help me?