Reputation: 121
In one of the levels of my game i have quite many big textures to draw. To give you idea what I'm talking about these are the textures sizes and the quantity in the level. 448x420 - 3, 315x400-2, 305x429 -3, 366x167-1, 356x265-4, 401x343-2, 387x251-1 plus about 20 elements with much smaller texture size.
The performance of my original implementation was 20fps. Then I created a single texture map that contained all the textures used in the level, this gave me about 3-4 extra fps. 24fps is not enough for me, what else can I try to optimize my performance?
Upvotes: 1
Views: 657
Reputation: 11990
You should try profiling your application, to check if the issues are actually in the graphics rendering or somewhere else.
There are some tools available for this, although most have limitations when working in WP7. The first recommendations would be Microsoft's Windows Phone profiler and PIX for graphics monitoring, mentioned in the post. There is also the XNA Framework Remote Performance Monitor, but as far as I can tell there is no WP7 compatible version.
Upvotes: 1
Reputation: 784
Some things that I could think of in a minute
In my experience, texel calls on mobile devices are quite heavy. Be sure to try and decrease the size of your textures as much as possible. Look at your project, if an object only takes about 10% of the screen, does it really need a texture of 128x128 or bigger? I don't know what kind of project and target device you use, but textures of 448x420(non power of two?!) seem way overkill for an mobile game. In fact, I'd recon you try and stay below a total combined texture usage of 1024x1024 or something?
Do I understand correct that this is your total texture size? (448 * 420 * 3) + (315 * 400 * 2) + (305 * 429 * 3) + (366 * 167) + (356 * 265 * 4) + (401 * 343 * 2) + (387 * 251) = 2.019.720 pixels (ignoring the ~20 elements you mentioned)
Which means assuming 32 bits textures, in theory, you are using about 64 MB of ram, only for texture storage (and not even assuming mipmaps and XNA not up-scaling to power of two textures) (not sure if XNA internally uses dds/dxt compression(?)). I can imagine this to be quite high for a mobile device.
Hope this might help solving your bottleneck.
Upvotes: 2