Blend Problem


Using textures above, i’m making a explosion particle effect.
But now i have got stuck in a problem. I set the two arguments of glBlendFunc as GL_ONE, GL_ONE so that overlapping parts among particles gets lighter. But except that all exsiting pixels in frame buffer are black, color of particle effect is deferrent from what i want because of the blendmode i set(in case of drawing partlce effects on white background color, outputs are white).
Now i consider all partcle effects are drawn into FBO before being drawn into frame buffer. But i think that’s not sensible idea cosidering performance. Is there any other solution or any other feasible way using blend functions?

But now i have got stuck in a problem. I set the two arguments of glBlendFunc as GL_ONE, GL_ONE so that overlapping parts among particles gets lighter.

Why do you want that?

Unless you’re doing HDR rendering, additive blending is not going to give good results. And if you are doing HDR rendering, having a “white background color” doesn’t make sense.

SO is there any solution to make flame/smoke effect? Basicaly, to render flame/smoke effect realistically, overlapping parts among particle textures in a viewport should be rendered lighter. So i add dest color and source color.

Flame is added light.
Smoke is filtered light.

So you need a blend that is able to do both.

Use premultiplied alpha !
http://home.comcast.net/~tom_forsyth/blog.wiki.html#[[Premultiplied%20alpha]]
glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);