Advertisement

transparent textures

Started by September 24, 2001 07:16 PM
3 comments, last by mSparks 23 years, 5 months ago
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..
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!"
Alex BroadwinA-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!"
Advertisement
"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!"
Alex BroadwinA-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!"
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.
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!"
Alex BroadwinA-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!"

This topic is closed to new replies.

Advertisement