Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Shadergraph shader variants

Discussion in 'Graphics Experimental Previews' started by RosieGarden, Mar 16, 2019.

  1. RosieGarden

    RosieGarden

    Joined:
    May 4, 2013
    Posts:
    33
    Is there a way with the shadergraphs currently to have shader variants, or would I need to make a separate shadergraph per option?

    Specifically looking for the behavior that the standard shader has, which enables and disables certain sections of the shader depending on whether or not certain textures are selected. (This obviously also requires editor scripts to work with it)
     
  2. Arycama

    Arycama

    Joined:
    May 25, 2014
    Posts:
    185
    I don't think this is possible, however it's probably one of the main reasons why I don't use the shader graph in a production environment. Being able to disable features you aren't using is important for improving performance, especially when targeting older mobile platforms.

    Making a new graph every time you want something minor, like a normal map or emissive map seems pretty unnecessary to me.
     
  3. RosieGarden

    RosieGarden

    Joined:
    May 4, 2013
    Posts:
    33
    Yeah, my current project makes heavy use of shader variants to turn on and off things, like blood splatters, snowcover, etc, so without them working, I can't feasably switch over.