Search Unity

Shader.Parse delays loading of AssetBundle containing no shader?!

Discussion in 'Editor & General Support' started by sradomski, Sep 30, 2015.

  1. sradomski

    sradomski

    Joined:
    Apr 21, 2015
    Posts:
    2
    Dear all,

    we created a set of TerrainData objects from the NASA SRTM mission for a digital elevation model of the earth. It's currently round about 10,000 tiles with 513x513 height samples each. Each tile is contained in its own asset and we successfully Resource.Load() and unload them dynamically within the Unity Editor with perfectly acceptable frame rates.

    When building the scene for e.g. the MacOSX platform we realized that there is a 2GB file limitation for all Resources/, so we had to resort to stream these tiles as AssetBundles via WWW objects. This also works in principle, however, when loading the asset from the bundle via LoadAllAssetsAsync<TerrainData>(), a considerable time (> 500ms) is spent in Shader.Parse(), even though each AssetBundle contains only a single TerrainData asset as can be confirmed from the bundle's manifest.

    There have been similar reports in the past [1][2], but their AssetBundles actually did contain custom shaders, something which is not given in our approach. The "case number" created from [2] is unavailable it seems.

    Can someone comment on or verify the issue? This is a real show stopper for us. Other approaches we tried so far:

    1. AssetDatabase.LoadAssetAtPath:
    Works great but is unavailable in an actual build as it is in the UnityEditor namespace.

    2. Resource.Load
    Runs into this archaic 2GB restriction, guess it ought to be enough for everyone (TM). Works great if less than 2GB of terrain data required.

    3. WWW coroutine / AssetBundle.LoadAllAssetsAsync
    Spends more than 500ms in Shader.Parse as described above

    Thank you
    Stefan

    [1] http://answers.unity3d.com/questions/971413/shaderparse-over-1000ms.html
    [2] http://forum.unity3d.com/threads/shader-parse-bad-performance.287202/
     

    Attached Files:

  2. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    Same issue here, have you already filed a bug report?
     
  3. sradomski

    sradomski

    Joined:
    Apr 21, 2015
    Posts:
    2