Archived

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

Subotron

Combining 2 blend modes?

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
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