TextureAtlas Slow Performance
See original GitHub issueIssue 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:
- Created 5 years ago
- Comments:14 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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.
Why not use AtlasManager’s asynchronous loading mechanism instead of calling finishLoading()? Do you really need all of those texture atlases immediately?