home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-

New Paste :: Recent Pastes:: Add Line Numbers

Alpha Textures by DELTRON

BMP's have no alpha channel.  You must load in the bmp data and its other
 information somewhere and "expose" the data to opengl when building
 the texture object.

When you build the RGB texture with opengl, it is JUST THAT, an RGB
 texture. (r,g,b,0)

glBlendFunc(GL_SRC_ALPHA, GL_ONE) is the typical blending function set
when using bmp's.  It will act as if it has an alpha channel against the color
black, but with other colors already present in the framebuffer it will 'add'.
This is often a desired effect in particle systems and so it may be confused
by some people.

Without an alpha channel you would have to use a texture mask to get the
same results.

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is the standard
blending function for an object that has an alpha channel.

- Delt.  Date: (a long time ago)


// Example source: