This topic is now archived and is closed to further replies.


This topic is 5966 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 need to display an image with a black background (it contains the title of my game) on the screen make the black invisible and not the text in the image trasparent. i decided to not use GL_BLEND but only GL_ALPHA_TEST with glAlphaFunc(GL_GREATER,0.0f) but the image rendered is with the black background. with the blend function the black disappears but i the text is semi transparent and bad looking. i use a TGA image file loaded with the code of Nehe without the compression. reading the code and the tutorial i''ve seen that with only TGA files with 32 BPP we can load the texture with the RGBA format. in 24BPP only RGB. So,i''ve tried to convert the image in 32BPP but none of my programs support 32 bit TGA files, only 24 max (Paint Shop Pro,IrfanView,etc).. Nehe in his tutorial says about 32 bpp tga files.. it''s true? how can i load this image correctly and render it ? the code for rendering is : glBindTexture(GL_TEXTURE_2D, texture_obj.ID); glEnable(GL_TEXTURE_2D); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER,0.0f); glBegin(GL_TRIANGLE_STRIP); glTexCoord2i(0,0); glVertex2i(10,485); glTexCoord2i(1,0); glVertex2i(210,485); glTexCoord2i(0,1); glVertex2i(10,410); glTexCoord2i(1,1); glVertex2i(210,410); glEnd(); I''ve tried all the possible options for AlphaFunc and Blend... help me!!!! :°(°°°

Share this post

Link to post
Share on other sites
Paint shop pro (at least version 7) can save 32bit Targa''s. Here''s who you do it:
  • Mask->New->Hide All or Show All
  • Mask->Edit
  • Draw the mask
  • Mask->Save to Alpha Channel
  • Ok
  • Now save it as a 24bit Targa, it will actually be 32bit
  • I agree, that is a weird way to do it

[Resist Windows XP''s Invasive Production Activation Technology!]

Share this post

Link to post
Share on other sites