Shadergraph, can't connect nodes directly, but indirectly is ok

This bug has annoyed me for years and throughout many Unity and Shader-Graph updates, but maybe it’s just me?

Am I missing something?

Can't connect nodes directly

I remember struggling with that for a while. I think the observation I was missing was that the nodes for vertex and fragment stages needed to be separate, as their function often differs between them (per vertex vs. per pixel). Intuitively it seems to make sense to just hand data back and forth, but if you created a mask using nodes that sample per-pixel, the result can’t be applied per-vertex without recalculating the entire branch using the same nodes but sampling per-vertex.

Shader Graph will usually block you from double-sampling a node for both stages. I don’t know what exactly is happening with the work around you’ve got there but I do remember doing something very similar with limited success.

My guess is that your upstream nodes are already participating in the fragment stage and therefor unusable by the vertex stage. I’d suggest duplicating the upstream branch with no connections to fragment blocks to see if that allows you to make the connection.

There is a way to store and read back out data between the stages using Custom Interpolators. I don’t think I’ve ever tried using them though.

Oh that might be it but still be far fetched and a bug nontheless. If shaderGraph really don’t want us to use the same node for both stage, for optimization purpose or else, this blocking logic should go throuth all nodes we may have in between, and/or we should see some kind of explanation.

I will test things with what you said in mind. Thanks again.