Jump to content
  • Advertisement
Sign in to follow this  
Synthesizer

[XNA] Strange framerate drop + Performance advices

This topic is 2919 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

Hello guys,
After adding functionality to my project I started working on performance. That's when I noticed a problem I'm having:

Randomly, after 2 or 3 seconds or so, the framerate terribly drops (only in one frame). After it, evrth normal again. 2, 3 seconds more... & again one terrible frame! It seems like a pattern, but I cannot find a logic...

Test Scenario:
I only draw a few object (5, 10, 15, no more, really low poly cones), I stare still at the models & the problem shows. I even draw nothing & the framerate drops from 60 to 53 or so showing the same pattern.
I don't know much about PIX, but i'm able to find the problematic frames in there:
Pix
here nProf result:
NProf
any idea of what it may be?


Well, apart from that:
I noticed drawing my models reeeeally decrease the speed: What's an acceptable polycount for a model? Let's say: for a man? & a house? Is it better if I split it in many models?
Max texture size I'm using is 2048x2048. Is it ok? (the heaviest: 1mb aprox, jpg).
Biggest X file: 63mb. I should split it I guess.

So well, I hope u can give me a tip!!
Thank you for your time & help!

Synth

Share this post


Link to post
Share on other sites
Advertisement
I don't use XNA, but from Android dev I've experienced similar regular drops and it was due to the garbage collector. the solution was to avoid every dynamic allocation.

jpg don't matter if it comes to textures, convert your texture to 32bit tga or tif (or at least bmp) and check for the size, that's probably what it is in memory. 2k by 2k sounds quite a lot, I think most games use 512 or 1024 as upper limit.

for polycount it really depends on what you draw, if you have just one house, then probably 100k polys is ok, if you want to draw a town with 1000 of them, then 100 polys might be your limit.

Share this post


Link to post
Share on other sites
Hi Krypt0n,
thanks for answering & thanks for ur info. I didn't know 2k x 2k was so big! I've already resized most of my textures, turning them into 512 or 1024 max (except 1 or 2 that i left in 2k for quality sake).

I'm not performing any memory allocation ("new...") during the Update cycle (just instancing BoundingSpheres & struct stuff).

I'm not sure if performance improved a bit or not, but the glitch is still there...
Is it possible that the map size influences a lot? I'm using a 500x500 heightmap to generate it.

Thanks in advance,
Synth

[Edited by - Synthesizer on October 25, 2010 6:58:34 PM]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!