I´ve wondered why my app has such a bad performance on Android although I´m using Tilesheet.drawTiles.
Therefore I played around a bit with the bunnymark example.
I saw that it´s no problem displaying thousands of the tiny bunny tiles at 60fps, but when using bigger tiles the fps go down rapidly. I didn´t expect this effect to be so drastically.
It seems to me filling a screen with tiles plus other objects at 60fps is hardly possible on Android?
Btw I was testing with a HTC One X at 720p, 1.5GHz Quad Core.
I thought a 2D game wouldn´t be such a problem as other 3D games are running fine on the same phone.
Is there something I missed or any additional performance tipps?
Yes, you are fill-rate bound most of time on mobile devices.
Some frameworks support features like this to redeuce amount of fill, but OpenFL itself doesn’t.
Tegra is using immediate rendering, but if you want to target other devices that uses Adreno, Mali, or PowerVR, you may also need to do other optimization, as most of mobile devices are using one of these GPUs.
2D games are more likely to be fill-rate bound than 3D games, because optimizations like early Z test won’t work for 2D rendering. PowerVR’s per-pixel Hidden Surface Removal(HSR) still works for 2D rendering though.
Oh wow, thank you! This goes far deeper into technically spheres than I wanted to go
I thought about pre-caching the background tiles into one large background image. Obviously this only works for static or slow-moving backgrounds.
Also isometric tiles tend to have alot of transparent pixels, so that is counter-productive as well.
Guess I´ll have to test alot here to get a good result.
I think if your tilesheet image exceeds hardware capabilities of device (on Android its often 2048x2048 pixels) it might be down-scaled - affecting performance. If I’m wrong I hope somebody will correct me
So you mean when I use a 4096x4096px spritesheet android will occasionally scale it down to 2048x2048? I´m new to android and I never heard of that, so if you have more information, feel free to share it!
I don’t think openfl does that, when I tried to use 4096x4096px spritesheet on device that allows maximum size of 2048x2048 my graphics were all black. You can use GL.getParameter(GL.MAX_TEXTURE_SIZE) to find out how big of a texture you can use.
Isn’t your device using Tegra3? HTC One X has two variants, one is dual-core Snapdragon-based and the other is Tegra3-based.
Adreno proiler only works on Snapdragon.
Ah thanks, I just quickly googled htc one x and snapdragon, found something and didn´t realise there are two versions of htc one x
I´ll check that tegra tool out!