Loadbmp fps drop

Previous topic - Next topic

Crivens

Ok so I'm doing a quick side project for my wife on my iPod 4th gen retina device.

Part of it involves having a nice non moving backdrop so I used loadbmp with a full 640x960 jpg. The fps went from 60 to 47. I have a load of other sprites onscreen but this one thing takes up 13fps cos when I take it out it's back to 60 again. Using it as a sprite keeps it about the same so I assume loadbmp is doing the same thing in the background. Using png has no impact so assume they are the same thing in memory.

But really 13fps (at least as its limited to 60 on the device) to just show the background?

My next game keeps 60fps on full retina but it uses 3d. Should I use 3D as the background for a pseudo 2d wallpaper? Or perhaps a smaller sprite zoomed? Will test more tomorrow.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

It does sound as though its repeataly re-loading the file, doesn't it - or the picture has to be continually decompressed in each loop...

msx

I had this problem and the reason was that loaded the bmp continuously

MrTAToad

In which like it sounds like a buggette

Ian Price

This goes back quite a long way, actually. I remember talking about this issue a year or more ago.
I came. I saw. I played.

MrTAToad

Might be time to make another post about it!

Crivens

Ang on. If the loadbmp command is at fault and perhaps is reloading the file every loop then why does loading it as a sprite instead and drawspriting it equal almost exact fps figures?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

Crivens

Grief. I threw pretty much everything at it. Everything from polyvector to 3D. I used 256 colour images instead of 24bit, lower res images zoomed up, several images split and drawn to make one big image, the lot pretty much. I found LOADBMP was the slowest, loading a sprite and pasting that every loop was very slightly faster, zooming a lower res sprite was about the same, 256 col made no difference (assume all the same in memory then), and 3D was the fastest coming out at about 50fps (so about 3-4 FPS better). But still, to just fill up a retina sized display it takes at least between 15 and 10fps? Crikey.

It seems though that it all depends on whats in the image. The one I had was brushed metal which is a lot of changing colours. My game that still runs at 60fps has a *lot* of black bits between pixels. In the end I went with 3 grey drawrects (needs to have darkened grey borders each side) and a nice big logo in the middle with not that many colours. FPS went right up again.

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

Quote from: Crivens on 2011-Oct-30
Ang on. If the loadbmp command is at fault and perhaps is reloading the file every loop then why does loading it as a sprite instead and drawspriting it equal almost exact fps figures?

Cheers
I would be surprised if that is the case - unless the bitmap format is different to the screen or you are using very high resolutions.

Crivens

So would I. I thought you mentioned it about though?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

MrTAToad

Yes, its a possibility - the other, of course, is stretching to the screen size ...

Crivens

I did that. Even with a lot smaller sized sprite zoomed to fit the screen I'm getting the same 13-14FPS drop.

Weirdly I started using a lot simpler wallpaper (big chunks of black and white sections) and the FPS went back to 60. Nice. Victory! After all the original wallpaper was quite detailed (brushed metal). So fair enough I left it at that. I added a few bits of code and a bit later compiled for the retina ipod again. And the FPS was back at 46. Eh?.... So I started hacking away at the changed code (WinMerge) and seriously I cannot see how it is now down to 46 again. The code I changed can be flipped in and out and there is no change. Get rid of the wallpaper (as a sprite rather than loadbmp) and it's back to 60FPS. Confused...

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

ampos

if !you aee going to draw the background each frame, perhaps it coild help to disable "clear backbuffer"...
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

Crivens

Ok, sounds very interesting, how do I do that?

Cheers
Current fave quote: Cause you like musicians and I like people with boobs.

ampos

Clearscreen -1
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE