Archived

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

Spencer

alpha textures and particles

Recommended Posts

Hi! I have som trouble with a particle system i am making. I am using a 1 byte alpha texture, shaped as a "sphere" opaque in the middle and more transparent to the sides...you know the drill Anyways....when i use it, i thought it would just be to bind this texture and then render my particles as two triangles with som color (glColor3f()) at each vertex and the texture would do the blending..but oh no..... so....how the heck do i do it? I mean...how do i tell opengl to use the alpha values from my texture when i render the particle.... thanks in advance

Share this post


Link to post
Share on other sites
By default, the final colour of a pixel is the texture colour multiplied by the interpolated vertex colour. Alpha is included in the equation.

Share this post


Link to post
Share on other sites
yeah...okay...that seems to be working....but now i have another problem...
the particles blend nicely with the background, but not with each other....
i can see the square shapes every time a particle is on top another...
suggestion?

thanks a bunch

--Spencer

"All in accordance with the profecy..."

Share this post


Link to post
Share on other sites
aight....solved it...
glDepthMask(false);

now i just have to figure out what it does

thanks all!


--Spencer

"All in accordance with the profecy..."

Share this post


Link to post
Share on other sites
I believe you have to turn off depth-testing when drawing the particles...

glDepthTest(false);
//draw particles
glDepthTest(true);

EDIT: uhm. typos

-Trond

[edited by - Trond A on April 22, 2004 4:41:31 AM]

[edited by - Trond A on April 22, 2004 4:42:09 AM]

Share this post


Link to post
Share on other sites