Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

best practices for managing a LOT of large textures at runtime

Discussion in 'Editor & General Support' started by WilB, Jun 30, 2013.

  1. WilB

    WilB

    Joined:
    Oct 25, 2012
    Posts:
    17
    hey guys,

    I'm working on a Windows desktop 2.5D RPG app that on average has about 5 very large (~ 3000x1080, but sometimes larger) textures per scene, across many dozens of scenes. Users can navigate between scenes in a matter of seconds. So while I hope / hoped to use dynamic scene texture loading unloading (on-demand), what I am seeing in testing thus far is pretty slow load times:
    • using WWW from disk ("file://") to load a scene's textures 1-by-1 gave me 5.8s load times for a typical scene
    • using compressed asset bundles to load the same scene's textures took 4.5s
    • forcing asset bundle textures into power-of-2 resolutions reduced this to about 3.8s
    I am wondering whether I will be better off putting the textures in a Resources folder so that they are part of the binary - will this be faster at runtime than simply loading files from disk / asset bundles (but at the expense of app load times)?

    On disk loads and/or asset bundle loads, is Unity post-processing each texture as it is loaded and, if so, is there a way to tell Unity to NOT do this? Will it do this for Resources assets as well?

    Curious if anyone else has had experience with projects on such a large scale... thanks.
     
  2. Deleted User

    Deleted User

    Guest

    i would go with Resources and load them at will like if they were prefabs and once done dump them, using resources is very nice because unity has a very nice memory handling of the resources, using the Resources class you can UnloadAsset or UnloadUnusedAssets , i have used the Resources class in the past and loaded a lot of stuff in a mobile game, and once i dont need them anymore, just dump them from memory, and load them again when you need it. works great.. remember to nullify all your container variables after unloading to be safe :)
     
  3. WilB

    WilB

    Joined:
    Oct 25, 2012
    Posts:
    17
    I think you've given me the confidence to go that route. I'll definitely have to be sure that I'm unloading resources as the user moves around the game or I will pretty quickly crash out of memory! Thanks for the advice. :)