Jump to content
  • Advertisement
Sign in to follow this  
subflood

blending

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

Hello, as some of you might already know[grin], I'm making a particle engine and I have yet another question for you fine folks. So far this is what I have: Image Hosted by ImageShack.us and my question to you guys is how can I switch to other blending types? For example, I see that additive blending makes things pretty bright/shiny but for some effects this blending is not right and something more "dull" is needed. In some particle editors you can switch between additive mode and just blend which looks a lot more dull and so how I can I switch between these blend modes? Currently I have: glBlendFunc(GL_SRC_ALPHA, GL_ONE);

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I think, you should look at glBlendFunc in MSDN to see all the parameters it may have. When you've chosen the ones you need, just call glBlendFunc once again in your program.

Share this post


Link to post
Share on other sites
You have many different parameters to change the type of blending. First of all, you should let the first parameter set to GL_SRC_ALPHA, because its important for fading. The most common second parameters used for particle systems are:
GL_ONE (additive)
GL_DST_ALPHA (depends on situation, in most cases additive)
GL_ONE_MINUS_SRC_ALPHA (this is the one you search)
GL_SRC_ALPHA_SATURATE (dunno, looks quite additive in my demo but didn't test it under real conditions :D)

there are some other parameters which are imho not very interesting for particles:
GL_SRC_COLOR, GL_DST_COLOR
GL_ONE_MINUS_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR
GL_ZERO

greets, KyRo1989

Share this post


Link to post
Share on other sites
Sign in to follow this  

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