Jump to content
  • Advertisement

Archived

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

mSparks

transparent textures

This topic is 6266 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

right, I need a function to set transparancy in textures easily. The best way I can see todo this is by having all pixels in the texture with an alpha channel of 1 EXECEPT those pixels which are pure blue (0,0,1)/ which get the alpha channel set to 0. has anybody done anything similar? or even made a function todo this..

Share this post


Link to post
Share on other sites
Advertisement
I personally tend to nake the out color black. It''s very easy too.

   
// make sure the transparent part of the texture isn''t drawn

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);


Then when you draw, black is transperant. (-:

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
"nake" = "make"

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

Share this post


Link to post
Share on other sites
heh, :D, big thanks m8.

I''ve wanted todo this for ages and now it looks like I''ve actually got all the rendering functions I need to make it look like I wanted.

Its gonna be a 3D stlye "missile command" which I''ve liked since I first saw it in [terminator 2?] this film, but wanted it upgrading to proper 3d with real looking destructable buildings etc, I have some neat little twists to add as well, so I''ll let you''ll know how I get on.

Share this post


Link to post
Share on other sites
Sounds great! Do keep us posted!

Alex Broadwin
A-Tronic Software & Design
-----
"if you fail in life, you were destined to fail. If you suceed in life, call me."
"The answer is out there."
"Please help, I''m using Windows!"

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!