How to speed up blending

Member
Posts: 65
Joined: 2009.03
Post: #1
I'm having a go at creating my own simple 2D particle system. I've got a simple smoke emitter working at the moment using a texture which I'm using for each particle. The texture I am using is a png which is 64x64.

I'm getting reasonable performance from my emitter along with my other game components, but I have noticed that just introducing the particle emitter makes the render utilization jump from around 50% to 90%. I've had a look through to see what could be causing this and it seems to be the blending as the utilization drops again if I disable blending. I'm also using vertex arrays and glDrawElements to push the particles to OpenGL.

So my question is, are there any tips and tricks for blending when creating a particle system which does not put as much load on the renderer?

FYI my blender settings are
Code:
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_BLEND_SRC);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Any suggestions would be great.

Thanks

MikeD
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #2
Draw less.
Quote this message in a reply
Member
Posts: 227
Joined: 2008.08
Post: #3
Im fairly sure that there is an option that will make it an-all-or-nothing deal will the blending for each fragment. I cant remember how, because I havent hassled with blending (I have hassled with texenv for water on a gf4mx Rasp)
But ideally you should try to reduce the amount of math required, drawing less alpha images is better in the long run for other performance reasons.
Quote this message in a reply
Member
Posts: 65
Joined: 2009.03
Post: #4
Thanks guys. I've moved to using GL_POINT_SPRITE_OES and managed to get the render utilization down to 50-60% so I'm going the right way now I think.

MikeD
Quote this message in a reply
Member
Posts: 166
Joined: 2009.04
Post: #5
MikeD Wrote:Thanks guys. I've moved to using GL_POINT_SPRITE_OES and managed to get the render utilization down to 50-60% so I'm going the right way now I think.

MikeD

That's strange ... generally particle rendering is just about always fillrate limited and unless you render thousands of very small particles , I wouldn't think moving to point sprites would make that much of a difference.
Quote this message in a reply
Post Reply