Jump to content

  • Log In with Google      Sign In   
  • Create Account

Blending problem


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 ak09   Members   -  Reputation: 131

Like
0Likes
Like

Posted 04 May 2013 - 06:09 PM

 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);
 

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);
...
 

err.PNG

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

 



Sponsor:

#2 irreversible   Crossbones+   -  Reputation: 1402

Like
1Likes
Like

Posted 05 May 2013 - 04:01 AM

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?



#3 ak09   Members   -  Reputation: 131

Like
0Likes
Like

Posted 05 May 2013 - 01:31 PM

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?



#4 irreversible   Crossbones+   -  Reputation: 1402

Like
0Likes
Like

Posted 07 May 2013 - 10:32 AM

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? :)






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS