Archived

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

NullPointer33

Transparent sprites

Recommended Posts

Just a question I''m starting to make a small opengl game I have a tiled map on screen. But now I want to render the player,objects etc, so...I can''t just texture the player to a quad since there''s stuff I don''t want to draw in there. How can I make opengl eliminate the pixels I don''t want to be drawn?

Share this post


Link to post
Share on other sites
You can just as easily use textures with an alpha layer. This would require using TGAs or another file format that has an alpha layer. These are often refered to as 32 bit textures. You can use alpha blending or clipping to do what you want.

Share this post


Link to post
Share on other sites
Thanks , yeah I''m using TGAs to load the textures with a small loader I wrote. I''ll take a look at the link see if I can figure it out...If I wanted to use a tga file how would that work exactly? Sorry kinda of new to opengl here

Share this post


Link to post
Share on other sites
Hey guys, I got it to work using masks but now I see a white line drawn across each sprite that is masked any ideas what might be causing this problem?

[edit]
ok never mind I had something else enabled that was causing that problem it works ok now yeah...I guess I'm just talking to myself at this point so I'm going to get some sleep...


[edited by - NullPointer33 on March 20, 2004 2:28:48 AM]

Share this post


Link to post
Share on other sites