← All ideas
  • Published 24 May 2020

Custom "Struct" connections for Cycles shading graphs

Hi all, Given that Cycles procedural shading networks get more and more complex, I think it would be a great productivity and efficiency boost to be able to combine multiple labeled values to customizable "Struct" node, pass them on to other modules as a single connection holding all the values, and then separate (break) the values for use using a corresponding separate-struct node. I actually do this today using the Combine and Separate Vector nodes, to bind data together into a single connection so its easier to handle and also keep the shading graph cleaner. But I think we should be able to define an expendable struct holding multiple labeled floats and vector values, kind of like a "brother" to the Group node, in which you can define inputs and will have a single output the passes all the combined data. The workflow can be that you define such a custom struct node similarly to the way we define Group nodes with their inputs, but here the list of labeled values is not "inputs" or "outputs" but simply the data members the struct holds with their labels. and then for every instance of the node use, you can set it to either combine input values and output one compound data output, or separate one compound connection to its individual components, so naturally you will only be allowed to connect the combined output of a Struct node to the combined input of another instance of the same Struct node. Hope I managed to explain the idea... I added a crude illustration of how it might look.. Thanks! Oded

Cycles_Struct.jpg

100%

Development Status: Open

Upvote 18 Downvote 0
odederell
24 May 2020

2 Comments

Something like this is much needed for the Compositor as well. This is an intriguing way of handling it.

3
zbindenmarc

Im not sure if I misunderstand something, but I think this is already possible with node groups like in the following image. The orange node is invoked in different places in the node tree. It is the parameter node so to say. The only convenience issue is, that one has to tab into the node to alter the values. It also seams to me, that blender doesn't like big node groups sometimes. In this particular shader I could not get around making multiple node groups for the driver values, otherwise it would run out of svm stack space. In cycles there is also a problem, that it runs out of svm stack space when I use the new vector math nodes. I often use custom ones made with vector separate and combine for that reason. I think much of this will change with everything nodes though. {attachment node_groupjpg}