Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

g7tommyB

Particle System Slow-Down

This topic is 5822 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!