Jump to content
  • Advertisement

Archived

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

BLZBub

Blending particles

This topic is 6156 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 there! I have just written a particle system which uses textured quads. I''m loading a tga and blending it using: glDepthMask(0) glBlendFunc(GL_SRC_ALPHA,GL_ONE) renderparticles() glDepthmask(1) this blends the particles nicely, but I have models behind the particle system which should be partially obscured but are not due to the depth mask. What is the best way to get around this??? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
The models aren''t obscured becuase you''re only adding color a''la a light effect. If you wanna obscure the background, you''ll need to use your source alpha to block out the background. GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA would seem to be appropriate (altho I like GL_ONE, GL_ONE_MINUS_SRC_ALPHA). This has the effect, tho, of making your particle drawing order somewhat important. You may need to sort your particles to draw back to front, but that''ll depend really on the actual effect you''re looking for.

What are your particles simulating?

Share this post


Link to post
Share on other sites
Thanks for your reply!

I had a look at my code and realised that I was drawing the particles before the game objects and not disabling sphere mapping - doh!

I actually found that GL_SRC_ALPHA,GL_ONE was the one to use for my purposes....but thanks again for your help!

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!