Blending problem

Started by
2 comments, last by irreversible 10 years, 11 months ago

The first image shows one circle overlapping another. They were drawn in a texture, with fbo, and blended with


glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
 

[attachment=15533:certo.PNG]
The second one shows the same stuff, but one circle is on textureA, and the other one on textureB (both handled by a fbo). Each texture was drawn on the screen, calling


glBindTexture(GL_TEXTURE_2D, textureA);
...
glBindTexture(GL_TEXTURE_2D, textureB);
...
 

[attachment=15534:err.PNG]

My question is: why the blending differs? How can I fix it?

Advertisement

For a better explanation on why alpha blending during runtime is wrong in the first place, check this out.

PS - what's in the alpha channel of the textures and the that of the active color when blending?

For a better explanation on why alpha blending during runtime is wrong in the first place, check this out.

PS - what's in the alpha channel of the textures and the that of the active color when blending?

Sorry, what do you mean?

Sorry, what do you mean?

Does the circle texture have an alpha channel? What's in it?

When blending, you'll usually want to use white color, eg:

glColor4f(1.f, 1.f, 1.f, fAlpha);

Or what is it that I failed to make sense about? :)

This topic is closed to new replies.

Advertisement