Jump to content

  • Log In with Google      Sign In   
  • Create Account

RGBA


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 SoD   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 August 2001 - 12:44 PM

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!!!! :°(°°°

Sponsor:

#2 Null and Void   Moderators   -  Reputation: 1087

Like
Likes
Like

Posted 12 August 2001 - 01:38 PM

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!]

#3 SoD   Members   -  Reputation: 122

Like
Likes
Like

Posted 13 August 2001 - 01:18 PM

It''s works but it''s a little difficult to modify correctly the borders of the text in the image thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS