Jump to content
  • Advertisement
Sign in to follow this  
mt_

Unity Can having few large textures vs many small improve *loading* time?

This topic is 605 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

We're at the end of a Unity game project and we're suffering from a pretty long loading time on mobile (~20 sec) for a scene to load. We don't have any rendering speed issues at the moment and that's partly why we didn't take the time and effort to make sure every single texture is in an atlas. 

So now I'm wondering, if we actually did move every single texture to a bunch of atlases and ended up with say 15 large atlases as opposed to ~hundred of textures could that improve loading time? I'm basically looking for a definite answer/explanation if and why loading many smaller textures to the RAM->GPU takes longer as compared to fewer but bigger/heavier ones.

 

 

Share this post


Link to post
Share on other sites
Advertisement

Just try and see?

 

Change the first 15 images to something large, and download only the first 15 images. For all other images, just use random base coordinates on the first 15 images, or even the same coordinates (although that will probably cause speed changes in rendering).

While the game is now totally broken graphically, it should give you a good indication of texture loading speed, without doing all the work of allocating all the images onto large textures.

 

 

Even less work could be to only load, and nothing else. Take your loader, and load what you have now, and measure time. Then make the first 15 big textures, and stop after loading 15 images.

Share this post


Link to post
Share on other sites

That's true. Just that with that kind of testing I'm not confident if the results will scale. I might record a slight decrease, lets say by 0.1s, but I can't be sure that the results will scale i.e. if I get 0.1s increase by getting rid of 15 textures will I get a 1s decrease by getting rid of 150? 

Basically the amount of content is large and it can be a big waste of time if it proves to just slightly improve the loading time. If anyone can provide any links/source as to why techicaly this would improve performance I'd be very thankful.

Edited by mt_

Share this post


Link to post
Share on other sites

That's true. Just that with that kind of testing I'm not confident if the results will scale. I might record a slight decrease, lets say by 0.1s, but I can't be sure that the results will scale i.e. if I get 0.1s increase by getting rid of 15 textures will I get a 1s decrease by getting rid of 150? 

I don't know of any links for what you're asking, but the above makes me think...

 

Why not just replace all textures with 15 large ones filled with random data?

 

Or create 2 projects/scenes -- 1 with just all the original textures, and 1 with 15 huge textures (potentially random noise if compression is a factor that needs to be considered).

 

Time how long they take to load and compare. That should give you a ballpark of what you can expect, I would imagine.

Share this post


Link to post
Share on other sites
That's true. Just that with that kind of testing I'm not confident if the results will scale. I might record a slight decrease, lets say by 0.1s, but I can't be sure that the results will scale i.e. if I get 0.1s increase by getting rid of 15 textures will I get a 1s decrease by getting rid of 150?

What I meant (and I think Lactose says too), is do a quick hack by whatever means to make it work with the large textures.

 

It can be hacky, dirty, etc, doesn't have to look good, the graphics may all be messed up in game play (random, all the same image, just plain black, whatever is least amount of work), the game doesn't even have to play. Ie just 15 blank textures will work for testing loading speed. What you want is a realistic figure on what you can expect wrt loading.

 

Edit: Once you have a number, you can decide whether it is worth investing the time to create the big textures for real, add all the small images, record their position, get those positions in-game, etc etc.

Edited by Alberth

Share this post


Link to post
Share on other sites

I guess the complexity is in changing the relevant assets to work from the atlas rather than individual textures; I can see how that is more work than just converting the graphics.

 

Profiling Unity scene load times is apparently a difficult thing to do. You probably just need to invest the time to do a decent test and see whether it will help you. Even if we could prove that atlases are faster in principle, we can't prove that texture loading is the bottleneck in your application.

Share this post


Link to post
Share on other sites
Maybe you can improve in the data that's fed to the game. Other file format that's prepared for the game.

Share this post


Link to post
Share on other sites

Unity handles that aspect of the loading process.

 

It doesn't handle it automatically, but does make it easy to try to see if it improves the problem.  You can also specify which assets which should never get cleared out between level loads, if I remember correctly.

Share this post


Link to post
Share on other sites

If we're talking about file formats - which is what Cozzie said - then yes, it does handle it automatically. I'm not sure what you're referring to.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!