blending

Started by
2 comments, last by subflood 18 years, 8 months ago
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);
Advertisement
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.
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
Allright, thanks guys.

This topic is closed to new replies.

Advertisement