Search Unity

Question Unclear 10.X ShaderGraph Master Block Nodes

Discussion in 'Shader Graph' started by BTStone, Jan 29, 2021.

  1. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
    Hey there,

    I upgraded an older project of mine from 7.X to Shadergraph 10.2. I did some minor shadergraph experiments, now I noticed (and also looked it up in the docs) that the master node has been replaced in a more flexible way with the vertex and fragment context. That's cool, I'm all for flexibility. But here's a thing I don't understand:

    How exactly can we manipulate them? This project uses URP and the 2D Renderer, therefore I'm creating Sprite Lit/Unlit Shadergraphs which results in this output:

    Default_SpriteLit_MasterOutput.png

    Now this is what the master output looks like when I set the Material in the Graph Settings to "Sprite Lit" in a new shadergraph.

    BUT! My older shadergraphs, which I created before the upgrade to ShaderGraph 10.X look a bit different, although they have been upgraded:

    Old_SpriteLit_MasterOutput.png

    As you see the older shadergraph have a node called "SpriteColor(4)" instead of the newer version, which is seperated between "Base Color(3)" and "Alpha(1)"

    Interestingly enough, if I select my old shadergraph, change the material in the Graph Settings from "Sprite Lit" to "Lit" and back to "Sprite Lit" the "SpriteColor" Block Node is deactivated in the master output.

    Ultimately my questions is:

    I know I can delete specific block nodes with rightclicking on them but, besides changing the Graph Settings Material Dropdown, how can I add/replace block nodes into the master output?
    Like how can I, in a fresh 10.X shadergraph, remove the BaseColor and Alpha node and replace it with the SpriteColor node?
     
  2. BTStone

    BTStone

    Joined:
    Mar 10, 2012
    Posts:
    1,422
  3. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    Very late to the party, but if you hover on the Master Stack and go all the way to the bottom, you'll see a thin blue line.
    Right click:

    upload_2021-5-6_19-1-43.png


    Choose Create Node, and it will bring up a special list of nodes that go in the stack:


    upload_2021-5-6_19-1-57.png

    Hope it's helpful! (to you or to anyone who stumbles into this)