Sign in to follow this  
canond

Lesson30 Texturing question

Recommended Posts

canond    122
I have a real quick question. I noticed that all the textures in Lesson 30 which deals w/ collision detection are bitmaps and are loaded in RGB format but the spark in the example has transparency. The black background of it doesn't show up in the demo. Can anyone tell me why this is?

Share this post


Link to post
Share on other sites
canond    122
How does opengl know which is the transparency color?

And why does he use this code

glTexImage2D(GL_TEXTURE_2D, 0, 3, image2->sizeX, image2->sizeY, 0, GL_RGB, GL_UNSIGNED_BYTE, image2->data);

for loading the bmp? Shouldn't it be 4 or GL_RGBA for the 3rd and 7th parameter?

Share this post


Link to post
Share on other sites
lc_overlord    436
because it uses glBlendFunc(GL_SRC_ALPHA, GL_ONE); blending and it blends everything tohether aditivly wich means that the darker it is the more transparent it gets, alpha in this case is used to decide the strength of this blending type and is set with glColor4f.
so the textures are still 24 bit bitmaps.
Nehes code can't load 32bit bitmaps, infact i have rearly seen 32bit bitmaps being used anywhere.
If you want 32 bit then tga is the way to go.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this