Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Shader Varient Collection, Problem adding the correct shaders.

Discussion in 'Shaders' started by yitz_unity, Oct 20, 2022.

  1. yitz_unity

    yitz_unity

    Joined:
    Jun 22, 2021
    Posts:
    12
    I am trying to preload some shaders. My game runs on WebGL, and if the shader variants load at run time, they take up to 100ms to load onto the GPU and cause a spike. I am trying to use a variant collection to include the shaders I want to preload.
    I am having a problem adding the shaders to the shader variant collection. In the inspector, I am trying to add the following shader variant for example:
    DIRECTIONAL FOG_EXP2 LIGHTPROBE_SH VERTEXLIGHT_ON _ALPHAPREMULTIPLY_ON _EMISSION

    I added all the keywords, but the shader does not appear in the list. There is no way to see the full list, it just mentions that it is cropped. "List of variants was cropped. Pick further keywords to narrow the selection." But I have already added all the keywords. Is there a way to sort this further, or to see the whole list?
    upload_2022-10-20_12-55-12.png

    I have also tried editing the variant collection in a text editor and adding the variant that way. Unity does not seem to register this. When it recompiles it, it doesn't display the new shader variant or any of the shaders below it in the inspector.

    Is there another way to add this shader variant to the collection?
     
    paulatwarp likes this.
  2. paulatwarp

    paulatwarp

    Joined:
    May 17, 2018
    Posts:
    132
    This has needed fixing for a while.
     
  3. ButtCleaves

    ButtCleaves

    Joined:
    Jun 17, 2015
    Posts:
    4
    This has needed fixing for 6 years and would take 10 seconds to fix