[Solved] Extremely slow when using TextureAtlas, Why?

Anything libgdx related goes here!

Re: Extremely slow when using TextureAtlas, Why?

Postby gamefish » Thu Dec 23, 2010 7:11 am

BurningHand wrote:Just ran some experiments with this on my ADP2. My findings:

Using as is:
5-6 fps with map sprite
42 fps with jeep sprite

Setting size of map sprite in pack file to the size of my screen (480 x 320):
61 fps

Setting size of jeep sprite in pack file to follow the power of two rule:
61 fps

Also:
I also tried it where I resize the sprite after load results in no improvement in fps.
Only changing it in the pack file itself made a difference.


I get the same result with you using my G2. But I don't understand what's the point, what's the difference between changing in pack file and resize after loaded?
More fancy android games at http://www.html5game.com
gamefish
 
Posts: 18
Joined: Sat Dec 18, 2010 4:20 am

Re: Extremely slow when using TextureAtlas, Why?

Postby mzechner » Thu Dec 23, 2010 9:36 am

guys, i had a few minutes to look at your code/images. there is no difference between TextureAtlas and Sprite. The only difference are your filters. I'll write a blog post about it in a minute. You'll be surprised. Suffice it to say: there's a reason why we force you to specify the texture filters when you create a Texture/TextureAtlas :)

I'll update this post with a link to the blog post.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: Extremely slow when using TextureAtlas, Why?

Postby mzechner » Thu Dec 23, 2010 11:52 am

mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: [Solved] Extremely slow when using TextureAtlas, Why?

Postby BurningHand » Thu Dec 23, 2010 2:12 pm

Cool, thanks Mario. To be honest I have never used TextureAtlas (whether that is a good thing or bad thing is another story) and always specify my texture filters using mipmaps so I hadn't come across this. Good stuff to know.
IRC: nexsoftware / mobidevelop; GitHub: MobiDevelop;
BurningHand
 
Posts: 2812
Joined: Mon Oct 25, 2010 4:35 am

Re: [Solved] Extremely slow when using TextureAtlas, Why?

Postby gamefish » Thu Dec 23, 2010 2:29 pm

Thanks a lot for the long nice article, Mario. Every thing is clear for me now :roll:
I'll keep asking you guys questions here but next time I'll double check my question and google more before post
More fancy android games at http://www.html5game.com
gamefish
 
Posts: 18
Joined: Sat Dec 18, 2010 4:20 am

Re: [Solved] Extremely slow when using TextureAtlas, Why?

Postby mzechner » Thu Dec 23, 2010 2:33 pm

Hey, those kind of questions are more then welcome. There was a chance that we actually screwed up something, so that never hurts. Glad it turned out to be just a minor filter setting :)
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Re: [Solved] Extremely slow when using TextureAtlas, Why?

Postby NateS » Thu Dec 23, 2010 7:42 pm

I will change TexturePacker to use nearest for both min and mag by default. You can change this with defaultFilterMin and defaultFilterMag on the TexturePacker.Settings class.
NateS
 
Posts: 1980
Joined: Fri Nov 12, 2010 11:08 am

Re: Extremely slow when using TextureAtlas, Why?

Postby laizhe » Fri Dec 24, 2010 4:41 am

mzechner wrote:http://www.badlogicgames.com/wordpress/?p=1403

Inhale it, breath it, live it!



the fps still keep to 10-15 when I run AtlasIssueTest.java after change the filter to 'filter: Linear, Nearest',is there any trick ?
I use simulator 。
laizhe
 
Posts: 15
Joined: Fri Nov 26, 2010 6:54 am

Re: [Solved] Extremely slow when using TextureAtlas, Why?

Postby mzechner » Fri Dec 24, 2010 8:14 am

Yes, don't ever use the emulator to benchmark OpenGL ES applications. It uses an extremely slow and buggy software renderer that is no indication of how your app will perform on a real device.
mzechner
Site Admin
 
Posts: 4879
Joined: Sat Jul 10, 2010 3:50 pm

Previous

Return to Libgdx

Who is online

Users browsing this forum: No registered users and 1 guest