Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualhaegarr

Posted 27 December 2012 - 01:07 PM

The usual way of transparency is with GL_SRC_ALPHA for the source, and GL_ONE_MINUS_SRC_ALPHA for the destination. It means that the alpha channel of the source is solely responsible for how blending will be done: A value of 1 stamps in the source color while a value of 0 will suppress the source color totally; values in-between will mix the source and destination, of course. However, your set-up of glBlendFunc lets the destination color ever come through, because you've chosen the destination factor to be 1.

 

You perhaps want to play with a tool like this to check-out how blending works.

 

BTW: You should not use a value outside [0,1] for the alpha (or any other) channel in glColor4f.


#1haegarr

Posted 27 December 2012 - 01:03 PM

The usual way of transparency is with GL_SRC_ALPHA for the source, and GL_ONE_MINUS_SRC_ALPHA for the destination. It means that the alpha channel of the source is solely responsible for how blending will be done: A value of 1 stamps in the source color while a value of 0 will suppress the source color totally; values in-between will mix the source and destination, of course. However, your set-up of glBlendFunc lets the destination color ever come through, because you've chosen the destination factor to be 1.

 

BTW: You should not use a value outside [0,1] for the alpha (or any other) channel in glColor4f.


PARTNERS