Jump to content
  • Advertisement

Archived

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

Subotron

Combining 2 blend modes?

This topic is 5648 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

I''m designing a particle system and I''ve got a problem. For the particles I want the blend values to be added together so you don''t just see the particle that''s in the front. I use glBlendFunc(GL_SRC_ALPHA,GL_ONE); to archieve this. But now the alpha channel of the texture (I use TGA) isn''t used, because it needs glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Is there a way I can combine these two (and other blend functions) to be used together? Thank you in advance for the help. | Panorama 3D Engine | Contact me | | MSDN | Google | SourceForge |

Share this post


Link to post
Share on other sites
Advertisement
Your post isn''t very clear, but I''ll try to answer your question:

If your particles are additive, for instance for a fire effect, just use GL_ONE,GL_ONE.

If you want a smoke effect, where the render colour gets closer to the particle colour the higher the alpha value, you need particles rendered with GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA.

You can''t just combine the blend modes, since they achieve different effects. You''ll have to render the different types of particles separately.

BTW, you''ll need to depth sort the particles rendered with GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, whereas the other particles won''t need depth sorting.

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!