Materials Workflow using NodeGroups, ShaderTrees, and Nodes

.start

I wanted to create one shader tree and then assign it to the three cubes in my scene.

The following screenshot was the resulting Node Group after promoting the Input/Output sockets. Promoting is as simple as pointing at the socket and dragging the mouse left/right for input/output sockets respectively.
When we create a NodeGroup (selecting the nodes and pressing CTL+G), Blender is creating a node of type Group and hooking the NodeGroup in the Group. Using the Group node, we can select all the NodeGroups in the scene.
The Datablocks view in the Outliner editor is a really nice tool to understand how Blender organizes all the data (Data structure.) 

Here we can easily see that a NodeGroup (is of type ShaderNodeTree) and consists mainly of
  1. Nodes
  2. Links
  3. Inputs
  4. Outputs
Expanding one of the NodeLink and investigating its properties side-by-side with the NodeTree in the Node editor paints a clear picture indeed.So far, this NodeGroup has not been connected to nodes inside a Material's ShaderNodeTree.
But now, the NodeGroup is being used inside a Materials ShaderNodeTree. So a Node based Material consists of a ShaderNodeTree containing Nodes and Groups. A Group Node consists of a ShaderNodeTree.
After incorporating the NodeGroup inside the ShaderTree for all the three materials, it was just a matter of creating overrides on the input sockets.
Overrides: Yellow color and Scale 1
Overrides: Red color and Scale 2
Overrides: Green color and Scale 4
Following is the render result.
So once can clearly see the flexibility offered by the NodeGroups for reusing functionality and also for overriding the default inputs for customizing the NodeGroups.

Now, if you want to update the NodeGroup, just select it and press the tab key so that it expands. Add the required nodes inside, make connections and promote the inputs/outputs. Its as simple as that.

I Love it!

References

Some More Examples


.end
satishgoda at gmail dot com

Popular posts from this blog

Blender 2.64 - Tutorial - Intro to Masking (Rotoscoping)

Hello OSL

Render Wedges using the Blender Video Sequence Editor