Particle System Slow-Down

Started by
10 comments, last by g7tommyB 21 years, 7 months ago
Hi all, I am making a particle system using texture mapped quads. The problem is that with just over 100 MAX_PARTICLES, the particle system causes a major slow-down to my scene. Does anyone know what may be a major cause for the slow down? What are some of the most known "performance intensive" problems that arise when using particle systems. I am texture binding with GL_MIPMAP_NEAREST_LINEAR (I think, can''t remember exactly) and using blending for the particle system. It is just too slow... My machine and video card are pretty fast for today''s gaming standards. It''s just my particle system that is probably messed up a little. TommyB
g7tommyB
Advertisement
It''s impossible to tell what the slow down is caused by, first we need your system specs. It probably is your particle system that is screwed up because 100 particles even with all the OpenGL nicest settings should not be slowing down a modern machine.

We might need to see some code if you think it''s your particle system. Are you re-cycling the particles or creating new ones? How are the new ones created if so? So many factors so little code.
Just a random guess!!.. You arn''t binding and storing textures per particle are you? That would slow you WAY down!
I am not binding and storing textures per particle. I bind the texture per my set of particles (all 100 of them). I am using a linked list as a data structure to store the particle info and yes I am re-cycling them, not destroying and creating new ones. I should also mention that my particle system is not the only thing "animating" on the screen, I also have a space-ship that is controlled via keyboard that the particle engine is for. I recalculate the new particle positions every single time in the loop.
When I turn the particle engine off, the space-ship moves a lot faster than when the particle engine is on.
I would post some code, but I am not at home right now and don''t have access to my code



TommyB
g7tommyB
yhou should be more concrete. please post your system specifications along with some bench marks.

how is your frame rate?

try adjusting the size of your particles (if they´re too big, you can really get performance problems on even the fastest GPUS).
Pentium 4 1.4 GHz
512 MB RAM
GeForce 3 Video Card

The particles are 0.025x0.025 in size and they are texture mapped.
Do you think that the way I am mapping textures may pose potential problems.
I do not know how to calculate frame rate. I am fairly fresh at this and would appreciate if someone told me how to calculate the FPS.

TommyB
g7tommyB
First off you may want to implement some sort of performance indicator so you can see how much an effect added systems have on your engine (the easiest being a simple FPS).

Look to see what state changes you are making between particles. Generally performance can be inhanced by limiting the number of opengl states you are making (assuming it actually is the opengl aspect which is slowing you down, for example you have a memory leak of some kind which could be slowing you down).

Sorry, can''t do any more without code
particles normally are blended + esp if theyre big this can cause fillrate problems, to see if this is the case make the window small eg 200x150pixels + see if the fps raises heaps if so then youre fillrate bound.
possible helps are enabling alphatesting with greater than 0.0 as well as blending

>>The particles are 0.025x0.025<<

that tells me nothing about there size ie it could mean they cover the whole window or less than 1 pixel.

to calculate fps?
try one of the nehe tutorials or www.gametutorials.com they should have an example

heres a simple way (not guarantted to work )


static int loop=0;
loop++;
if ( loop%50==0)
{
static int last_t;
int t = clock();
printf("%f\n", 1.0/((t-last_t)/1000.0) );
last_t=t;
loop=0;
}

http://uk.geocities.com/sloppyturds/gotterdammerung.html
Thanks a lot to all of you for all of your help.
I will try all of your suggestions and will keep you
posted. In addition, I''ll try to get some more details.

TommyB
g7tommyB
You might want to try creating the particles using triangle strips instead of quads.

I asked one of the Black Robes why the Deceiver wasn''t going to stay to defend the dam, and he tersely replied: "He goes to warn the Emperor; moving through odd angles, faster than any man, and if unobserved, much faster than that."

Elemental Engine: ryan_lurvey.tripod.com/engine.html
I asked one of the Black Robes why the Deceiver wasn't going to stay to defend the dam, and he tersely replied: "He goes to warn the Emperor; moving through odd angles, faster than any man, and if unobserved, much faster than that."Elemental Engine: ryan_lurvey.tripod.com/engine.html

This topic is closed to new replies.

Advertisement