How to do transparent textures in OpenGL?
I''ve got the alpha values set in my texture..I''ve got the code that enables the alpha test when using a transparent texture..I don''t need to do any blending, I just need to see through certain parts of the texture..I''ve manually set the alpha values in the texture to 1''s and 0''s, so that''s ready to go..I found a good tutorial on NeHe''s site but it illustrates a double-pass system rather than using the alpha channel..I''m sure it''s something specific that I need to set with OpenGL before I can see the results, but I don''t know what...any suggestions?
"Like all good things, it starts with a monkey.."
"Like all good things, it starts with a monkey.."
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5); // whatever
now every texel with a alpha less than 0.5 wont get draw on the screen
note alpha testing is quicker than doing blending
glAlphaFunc(GL_GREATER,0.5); // whatever
now every texel with a alpha less than 0.5 wont get draw on the screen
note alpha testing is quicker than doing blending
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5);
this is exactly what I have already..I think I need to rip apart the TGA loader and double check my alpha values..more fun
"Like all good things, it starts with a monkey.."
glAlphaFunc(GL_GREATER,0.5);
this is exactly what I have already..I think I need to rip apart the TGA loader and double check my alpha values..more fun
"Like all good things, it starts with a monkey.."
"Like all good things, it starts with a monkey.."
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement