The Khronos Group - a non-profit industry consortium to develop, publish and promote open standard, royalty-free media authoring and acceleration standards for desktop and handheld devices, combined with conformance qualification programs for platform and device interoperability.

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

glClear alpha vs geometry alpha -- blending result confusin

There are a couple threads on *nearly* this topic, but they are either divergent or died out.

I have a framebuffer that I have to have a meaningful alpha plane in. The image gets rendered and then gets blended based on reulting alpha per pixel in the framebuffer (hardware combiner)

So I do a
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

Draw the geometry which has some transparent components.
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Since I have cleared with opaque black clear color, I expect the results to be opaque. But they are the alpha of the geometry rendered over it - SRC_ALPHA.

Huh?

In other cases I will NEED to render the SRC_ALPHA into the framebuffer - to "cut a hole" in the scene.

So what little dance do I need to do to control when the SRC_ALPHA goes straight to the framebuffer (or FBO) from the SRC in order to "cut through" the scene and when it blends with the existing background to be "more opaque" as layers get added?

It has been a long day on this one.
Any thoughts are greatly appreciated?