Archived

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

executor_2k2

How to make background in TGAs disappear

Recommended Posts

executor_2k2    122
I just got TGAs working in my particle system. One problem tho. When I make a TGA and use it in my program the background still appears. I am using an alpha channel in my TGAs so its GL_RGBA. I would like to know how to make the background go away. Do I just edit my TGA code to keep the background from showing? Or am i using my alpha mask incorrectly in photoshop? Thanks Edited by - executor_2k2 on January 30, 2002 7:45:28 PM

Share this post


Link to post
Share on other sites
Null and Void    1088
Did you enable blending? If not, the alpha channel is just sitting there doing nothing. You basically do this (only while you're doing particles though, turn it off afterwards, like I show):
    
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

/*
Render
*/


glDisable(GL_BLEND);




Edited by - Null and Void on January 30, 2002 7:56:17 PM

Share this post


Link to post
Share on other sites
Gammastrahler    150
are you using depth testing? if so, disable Z-buffer writing before blending. in my engine, it works only this way:

    
glDepthMask(GL_FALSE);
glEnable(GL_BLEND);
glBlendFunc(..., ...);
// render


glDepthMask(GL_TRUE);




Edited by - gammastrahler on January 30, 2002 8:09:45 PM

Share this post


Link to post
Share on other sites