Blending bitmaps
Lesson 9 uses alpha blending to blend out the black around a bitmap.
This works fine but it seems to me as if it continues to blend all the other colours too so you can see 1 image below the other.
Is there a way to stop this ?
Thanks
Trager
Thanks Ruudje I didnt see that tutorial.
I noticed at the bottom of the tutorial it suggests adding an alpha channel to the image and setting the alpha values of each pixel as you desire.
I decided to go for this option as I think it will be more suited to my needs are probably faster too.
The textured plains (sprites) come up fine but the blending still isnt right. I think the problem probably lies in one or both of these two lines.
gluBuild2DMipmaps(GL_TEXTURE_2D,3, stDB_Bitmaps[stDB_Current_Bitmap].Width, stDB_Bitmaps[stDB_Current_Bitmap].Height, GL_RGBA, GL_UNSIGNED_BYTE, stDB_Bitmaps[stDB_Current_Bitmap].Data);
and
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
Can anyone offer any pointers?
Thanks
Trager
I noticed at the bottom of the tutorial it suggests adding an alpha channel to the image and setting the alpha values of each pixel as you desire.
I decided to go for this option as I think it will be more suited to my needs are probably faster too.
The textured plains (sprites) come up fine but the blending still isnt right. I think the problem probably lies in one or both of these two lines.
gluBuild2DMipmaps(GL_TEXTURE_2D,3, stDB_Bitmaps[stDB_Current_Bitmap].Width, stDB_Bitmaps[stDB_Current_Bitmap].Height, GL_RGBA, GL_UNSIGNED_BYTE, stDB_Bitmaps[stDB_Current_Bitmap].Data);
and
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
Can anyone offer any pointers?
Thanks
Trager
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement