Connecting subgraphs in material editor trough variables?

When I am working on more complex materials, I often find that I use the results of some calculations (for example uv coordinates with some calculated offset) in different parts of the material.
Now I have to drag a connection from this subgraph to all the places where I use it, and this gets messy. I was wondering if it is not possible to do this differently, namely by storing the calculated value in some ‘variable node’ and then using a similar ‘variable node’ (with the same variable name) someplace else in the graph to read out the calculated value.

So basically the funcionality would be exactly the same as when I would connect it normally, but now there don’t have to be ‘visual’ connection between the two, and I can divide my material into subgraphs. I think that could really improve how ‘readable’ complex materials are.

I looked for this feature but couldn’t find a node (or something else) that would do this. Is this possible? and if not, can I make a feature request for it?

Look into Material Functions. You can create functions for your commonly used calculations and then use those functions anywhere in any material.

Thanks for your reply, that is very usefull to know. But what I can tell, material function are about reusing functionality/calculations, which is very useful. But what I’m talking about is reusing results from calculations elsewhere in the material graph, without having these connector-lines all over the place. So I don’t think that is the same thing!

I see. Yeah, it’s not exactly the same thing but you’ll get the function as a single node which will give you the result as an output pin so it will still be less messy. However, if you still want to make a feature request feel free to open a new thread here:

https://forums.unrealengine.com/forumdisplay.php?24-Feedback-for-Epic