How to make background in TGAs disappear
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
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):
Edited by - Null and Void on January 30, 2002 7:56:17 PM
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
are you using depth testing? if so, disable Z-buffer writing before blending. in my engine, it works only this way:
Edited by - gammastrahler on January 30, 2002 8:09:45 PM
glDepthMask(GL_FALSE);glEnable(GL_BLEND);glBlendFunc(..., ...);// renderglDepthMask(GL_TRUE);
Edited by - gammastrahler on January 30, 2002 8:09:45 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement