alpha textures and particles
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
Look into blending. You have to enable it and set different values of opacity with a call to glColor4f().
yes...but i want the texture to be the alpha values...??
--Spencer
"All in accordance with the profecy..."
--Spencer
"All in accordance with the profecy..."
By default, the final colour of a pixel is the texture colour multiplied by the interpolated vertex colour. Alpha is included in the equation.
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..."
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..."
aight....solved it...
glDepthMask(false);
now i just have to figure out what it does
thanks all!
--Spencer
"All in accordance with the profecy..."
glDepthMask(false);
now i just have to figure out what it does
thanks all!
--Spencer
"All in accordance with the profecy..."
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]
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]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement