• Advertisement
Sign in to follow this  

Lesson30 Texturing question

This topic is 4393 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Sign in to follow this  

  • Advertisement