Hello! I am making a master material and I want it to have an option to switch between normal asset UVs, World Aligned UVs and Triplanar. Is there a way to make a switch that would allow me to select which outcome I want in a material intance?
I have attached a screenshot of my albedo graph, currently I can switch between the normal UVs and WorldAlign, and I want to add a third option for TriPlanar.
One thing to note is that while @ClockworkOcean is correct and Switches are a great way to have multiple inputs to choose from, Switches need to calculate all shader instructions from all inputs, even if their branch is not technically in use. The only shader graph features that allow you to switch between instructions without incurring the additional costs are Static Switches/Static Switch Parameters and Static Bools/Static Bool Parameters.
When I have multiple branches for the user to choose from, I usually chain the switches together and have them all set to “Off” by default, with the very last option in the chain being true by default. This does the trick of exposing all of the options to the user within the instance, but does remove what options are visible if they set a switch higher up on the chain to “True”.
Still, this is the method that I would recommend always using unless you know what you’re doing and have a specific reason to use a Switch instead. For something like this, where you’re switching between 3 different calculations where two of them are quite expensive and multiple texture samples, you should definitely use the Static Switch/Bool Parameter.