Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Endless Shader.EditorLoadVariant stalls reaching a full minute

Discussion in 'FPS.Sample Game' started by bac9-flcl, Oct 25, 2018.

  1. bac9-flcl

    bac9-flcl

    Joined:
    Dec 5, 2012
    Posts:
    779
    Is there a way to precompile/preload all shader variants used by the main scene in this project? I'm unable to use the preview mode yet, since the Editor constantly hangs for up to a minute to load shader variants. Maybe creating a shader variant collection can help with that?

    The variant loading itself is less than a half of the time in the stalls, though - it looks like updates to all systems pile up while editor loads the variants, and cause a humongous spike on next frame, with Game.Update taking 3000ms+ and requiring collection of 30mb+ by GC.

    Edit: Thankfully, that's not a repeating issue and pushing through the level blindly for a while seemed to force loading of most variants for me. Still, I'd like to know what best practices for avoiding this issue are - it's occasionally an inconvenience on my project too.
     
    Last edited: Oct 25, 2018