Jump to content
  • Advertisement

Archived

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

Spencer

alpha textures and particles

This topic is 5204 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
yes...but i want the texture to be the alpha values...??

--Spencer

"All in accordance with the profecy..."

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!