Jump to content
  • Advertisement

Archived

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

SoD

RGBA

This topic is 6214 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
Advertisement
It''s works but it''s a little difficult to modify correctly the borders of the text in the image thanks!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!