Skip to main content
gamedev.net
🔒 Locked

Slowdown?

Started by Erondial 2 replies 600+ views
Original Post
Erondial
Erondial
After I put a few hundred particles on screen (I'm doing this in 2D), my program starts to slow down noticably... these particles aren't huge, but they're big enough... so should they be causing this kind of slowdown? Or am I doing something wrong? (I'm on a Radeon 7200, on a AMD 1.33 GHz with 1GB of RAM)
Sr_Guapo
Sr_Guapo
How are you dealing with the particles? Are you just uses the immediate mode to draw them? Are you having to set the various states for each particle?

You may want to look into vertex arrays and/or VBOs. Thgey will be quite a bit faster than pure immediate mode.
Sean Henley [C++ Tutor]Rensselaer Polytechnic Institute
Rasmadrak
Rasmadrak
Don't judge performance by fps drops... since these are misleading. A "huge" drop in frames doesn't mean that the performance will suffer etc.

Also, you need to use time-independant updates for movement.

btw:
Someone once posted an article about how performance and frames per second relate.... does anyone reckognize this, if so - please post again! :)
"Game Maker For Life, probably never professional thou." =)
OrangyTang
OrangyTang
Quote:
Original post by Sr_Guapo
How are you dealing with the particles? Are you just uses the immediate mode to draw them? Are you having to set the various states for each particle?

You may want to look into vertex arrays and/or VBOs. Thgey will be quite a bit faster than pure immediate mode.

Particles (especially 2d ones) are almost always fill-limited, so VBOs or similar aren't going to help.

Erondial: Check to see if you're fill limited. Make all the particles twice as large/small and see if you get a corresponding FPS change. (for more accurate and sensible profiling results, turn off VSync and measure the time for a frame rather than FPS which is non-linear).

If you're fill limited theres not much you can do except physically draw less pixels. Adding alpha testing (as well as the existing blending) can help by discarding the very low alpha fragments. Beyond that I think you're stuck with drawing less particles, drawing fewer particles, or dropping your resolution.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.