I have created a subgraph that, among other ones, takes a Vector2 as a parameter meant for UV input. But quite often that parameter is left assigned to a UV0 node that I create. Is there a way to make the subgraph’s parameter by default to be assigned to a UV0 the way this is done with SameplTexture2D or TilingAndOffset nodes?
Found out it is called Port Binding but still did not get how to apply it.
This is not currently supported but it’s a feature request we know about and want to work on in the future.
+1 for this request!
It’d be pretty cool to be able to mark Vector2 inputs as a UV channel by default
Roadmap says its released on 2021 LTS, but I don’t see any option to set default values.
How to set default values? Using 2022.2.0b8.
Hey, we would love to use this feature, but aren’t sure how to? Is it actually released?
Edit: Currently when building a Subgraph with a custom UV you provide as a SubGraph-Parameter the preview inside of ShaderGraph is completely unusable, because the UV is always 0,0 for every pixel.
This makes SubGraphs really hard to debug as soon as you want to use anything but the default UV as input.
In case it helps anyone, here’s how you can set the default for an input port on a sub-graph in Shader Graph when there’s nothing connected.
The image below shows how to use the Branch On Input Connection node.
You simply pass the input node → both the input and Connected ports, and set NotConnected to your default.
In my case I want the default to be centered UVs for a custom Circle SDF node.
So without anything connected to UVs it correctly shows the default centered UVs.
The default label also displays.
If I actually connect to the uv port, we know it’s now taking the non-centered UV that’s connected.
my input(p) node would not connect to anything
Unity 2022.3.0 - BuildInRP