question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TextureAtlas Slow Performance

See original GitHub issue

Issue details

TextureAtlas objects take far too long to create. This is creating a major bottleneck in my application right now because I cannot add more characters until I resolve this problem.

An .atlas file with 500 lines and 4 associated images with dimensions less than 2048x2048 takes roughly 100-200 milliseconds. This needs to be improved as I am initializing roughly 20-24 atlases for a total overhead of 5000-7000 milliseconds. Using a single atlas does not resolve the problem.

Reproduction steps/code

AssetManager manager = new AssetManager(new InternalFileHandleResolver()); manager.load("path/to/atlas", TextureAtlas.class); manager.finishLoading();

Version of LibGDX and/or relevant dependencies

1.9.8

Stacktrace

None

Please select the affected platforms

  • Android
  • iOS (robovm)
  • iOS (MOE)
  • HTML/GWT
  • Windows
  • Linux
  • MacOS

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MobiDevelopcommented, Jul 9, 2018

I see, well, reality is that things take time. Immediately loading 20 texture atlases with each having 4 images of 2048 x 2048 is absolutely going to take substantial time no matter how ‘optimized’ the reading portion is.

Maybe a pre-render background for the authentication screen is warranted so that you can quickly load that then load other stuff you’ll need while the authentication is taking place.

1reaction
MobiDevelopcommented, Jul 9, 2018

Why not use AtlasManager’s asynchronous loading mechanism instead of calling finishLoading()? Do you really need all of those texture atlases immediately?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maximizing Texture Performance - Apple Developer
A texture atlas is a group of related textures that are used together in your game. ... SpriteKit uses texture atlases to improve...
Read more >
Tile Game slow. Lots of sprites. Texture atlas? - Unity Answers
Any ideas how to improve performance of this dumb game, which for performace reasons I tried to program with Python+Pygame, C#+WinForms and ...
Read more >
Use Texture Atlases in Unity to Improve Performance
Performance on for mobile games helps get more downloads because more devices will be able to run your game smoothly. For 2D Unity...
Read more >
How can I improve the performance of texture switching ...
State changes on the GPU are slow and should be down as infrequently as possible. This includes changes of texture and shader state....
Read more >
java - Will I get performance gains from using a texture atlas ...
I am developing a game using JavaFX for an assignment. I am familiar with texture atlases and the fact that they bring performance...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found