Archived

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

dadio

tranparent textures

Recommended Posts

Seaman    122
I think he means to use alpha testing, you give your image an alpha channel and then makle the bits you want for example 1 and the bits you dont want 0.
Then enable GL_ALPHA_TEST (I think thats it), and use glAlphaFunc();(again I think thats it) to set up the parameters so it for example only only renders the texels where there alpha is 1. this wy the rest wont be draw.
Look up those functiuons and it should be come clear, hope I got the names right.

Share this post


Link to post
Share on other sites
mittens    1323
What you need to do is make a 32 bit targa with a transparent background (GIMP and Photoshop are the best for that... and GIMP is free: [url]http://www.gimp.org[/url]), and then do this inside your program:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//now render the images

------------------------------
Trent (ShiningKnight)
E-mail me
Shining Darkness- A division of Chromesphere Studios

Share this post


Link to post
Share on other sites
Dragonus    122
quote:
Original post by Seaman
I think he means to use alpha testing, you give your image an alpha channel and then makle the bits you want for example 1 and the bits you dont want 0.
Then enable GL_ALPHA_TEST (I think thats it), and use glAlphaFunc();(again I think thats it) to set up the parameters so it for example only only renders the texels where there alpha is 1. this wy the rest wont be draw.
Look up those functiuons and it should be come clear, hope I got the names right.



Pretty much, that''s what I did.

glAlphaFunc(GL_GREATER, 0.3f);
glEnable(GL_ALPHA_TEST);

~ Dragonus :D

Share this post


Link to post
Share on other sites
PyroBoy    122
The way I like to do it is to have my images created with a full alpha channel, and saved as a .png. Then rendered with per-pixel alpha from the texture''s alpha channel. This does the trick nicely, and you can blur the edges of he alpha channel in photoshop, resulting in some fake edge antialiasing.

Share this post


Link to post
Share on other sites