iDevGames Forums
How to speed up blending - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: How to speed up blending (/thread-1429.html)



How to speed up blending - MikeD - Apr 19, 2009 01:15 PM

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


How to speed up blending - arekkusu - Apr 19, 2009 02:03 PM

Draw less.


How to speed up blending - Oddity007 - Apr 19, 2009 02:10 PM

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.


How to speed up blending - MikeD - Apr 20, 2009 05:55 AM

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


How to speed up blending - warmi - Apr 24, 2009 07:27 AM

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.