Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Async texture upload - Leveraging it

Discussion in '5.3 Beta' started by JJJohan1, Oct 8, 2015.

  1. JJJohan1


    Oct 13, 2013

    I was excited to read that the 5.3 Beta comes with asynchronous texture upload capabilities. However after some browsing I'm somewhat embarrassed to say I've had some trouble understanding its operation.

    I work with an application that performs a high number of tile-based image loading operations via Texture2D.LoadImage(), it would certainly be beneficial to perform as much texture processing asynchronously if possible.

    I'm reading the Async Texture Upload document located in the 'Preview of 5.3' thread. Unfortunately I can't post the relevant excerpt here as a convenience because it blocks me from posting due to "spam".
    • With regards to "It works with textures that are set to Not read-write enabled in the project", does this mean that async texture uploading only works with textures included in the project? That seems to conflict the last sentence where runtime loading from the Resources folder is unchanged.
    So if it doesn't work with LoadImage(), disregard the below questions:
    • If I'm misunderstanding and it does work with LoadImage(), Currently I acquire 'byte[]' byte arrays via HTTP downloads that contain images which are then loaded via creating a new Texture2D, then loading it with LoadImage(). Is this applicable?
    • Is there another way to monitor the completion of async texture upload other than listening for AwakeFromLoad()? I process a lot of textures during runtime in a single object, and those textures are not always used alongside creation of new GameObjects, they are also used to update old tiles, thus the AwakeFromLoad() method is not viable.
  2. Venkify


    Unity Technologies

    Apr 7, 2015
    Hi Johan,

    Right now, only not read-write enabled textures that are included in the project are supported. They are
    1) loaded asynchronously from resS files where they are built to and
    2) uploaded to GPU on Render-Thread.

    LoadImage API or runtime loading from resources remain unchanged. Also regarding completion status, its guaranteed to be uploaded to GPU before being used. So explicit check for completion is not necessary.
  3. bdominguezvw


    Dec 4, 2013
    Does it mean that you will do it for external loaded textures via Texture2D.LoadImage() ??

    There are many projects made with Unity that are not games and load from web services, xmls and such things multimedia data like textures, audios or videos.
  4. WisockiJr


    Jul 5, 2014
    SO - acording to "Venkify" member from Unity staff, Unity3D will NOT support asynchronous texture loading, it is a shame, that besides Unity3D being the main platform for building VR apps, we still CANNOT build VR applications yet, and Unity does not care at all - no word on it, simply ignoring the fact that asynchronous texture upload is a MUST for VR applications, and that a lot of developers are using unity not only for games, but for VR applications (Android and iOS), we really need to load very large textures asynchronously. please Unity stop ignoring the major issue that makes unity unusable for VR picture browsing... we need to be able to load very large images at runtime, that are not included in the project.