Local Variables
…a local variable is a variable that is given local scope.
Wikipedia
Material node graphs currently don’t offer much beyond direct parameter references. There are no outside ‘global’ references, so any ‘variable’ we declare in a node graph can only be local by the nature of the graph’s design. Technically speaking, the Unreal Engine’s Material Editor does not have local variable declarations, but rather a Named Reroute Node that can act as a variable although it simply hides the connecting node lines.
So let’s look at how they can help clean up our graphs.
UE: Named Reroute Nodes
The most powerful tool to breaking up the node spaghetti – the Named Reroute Node.
Use them like Local Variables. Immediately offloading Parameter (and Function) Inputs to Named Reroute Nodes allows you to cleanly separate and block off an organized chunk of nodes. this makes it easier to layout the order of inputs for the Editor UI.
The most powerful tool to breaking up the node spaghetti – the Named Reroute Node.
Use them like Local Variables. Immediately offloading Parameter (and Function) Inputs to Named Reroute Nodes allows you to cleanly separate and block off an organized chunk of nodes. this makes it easier to layout the order of inputs for the Editor UI.
While the Unity Engine’s Shader Graph doesn’t have an equivalent node, the Amplify Shader Editor (ASE) plugin does utilize actual variable declarations, making it a powerful tool for advanced shader development.