Big textures = Low FPS

I want to have a plain blue texture as my background sky, so I create a texture in-game with a single pixel then scale it up to fill the screen, this alone caused the FPS to drop by 10-15 FPS. I noticed through testing on device (iPhone 4) that as the texture expands to fill the screen, the FPS drops proportionately, so I assumed that scaling textures is expensive and just added a screen sized plain texture to my content and loaded it, but this made no difference and it still lags as much. Generally it seems drawing a texture that fills any significant portion of the screen causes a proportional and significant reduction in FPS. How to fix this?

Rendering is not free… but a 15 fps hit is not possible for simply rendering a quad to the screen.

Be sure you’re running a release build.

I did release the game to the app store and it still lags on the iPhone 4, so it does happen in release build too. While debugging, if I switch the background off the FPS goes from 40 to 60. If I decrease the size of the background to about 1/4 of the screen, then it no longer affects the FPS. I dont know whats going on underneath and how to work around it.

heh I went into creating a test project to prove my point, only to find out the FPS wasnt affected by the size of the texture… I wonder what am doing wrong such that the FPS drops only when the texture size is large (full screen size). I’ll report back.

Ok so I guess the problem still holds. I created a test project that illustrates it. I draw a blank texture 10 times in each draw call. On older devices such as iPhone 4, you can see that the FPS counter drops down only as the texture scale increases. This is the issue and I do not understand why and how to solve it. Sample link here (dropbox)

There is no mystery in this.

The pixels rendered to the screen are not free. There is a limited amount of bandwidth for rendering pixels per-frame. If you render more than the GPU on the device can handle, you see lower and lower frame rates.

In particular mobile devices have very tight limits on fillrate. Depending on the device you can barely render a full screen quad to the scene 5 to 10 times over and maintain 60 fps.

The dramatic drop in FPS makes me suspect you are already are pushing the fillrate to its limits. Some basic tips:

  • Avoid wasted rendering… rendering over the same pixels is not free.
  • If your scene has depth make sure you enable z buffering… it improves rendering performance.
  • Keep your textures to reasonable sizes… if the texture is higher resolution than your screen, consider if it is really needed.
  • Use hardware texture compression… they render faster.
1 Like

I want to do that, but I cant find documentation on what is required by MonoGame for each platform (iOS, Android and Windows which I guess means WP8) in my Visual Studio 2010 content project. There is the compression mode PVRTC and the texture format DXT. What should the selected values of these 2 options be for each platform?