Creating A Custom Blend Node In Substance Designer
The blend tool is arguably one of the most important substance designer nodes. The blend node is used to layer different images to create interesting results and effects. The blend node is comparable to photoshop layers with different layer styles and opacity levels.
A problem I run into is since the blend node is so commonly used, I’m finding myself stacking blends on top of each other until it’s a tangled mess. Multiple blends create a node staircase that can make up a lot of screen space even if you try to stay organized. A great feature of substance designer is once a graph is created you can save it to the substance library to reuse it anywhere in future projects. This type of reusability is like the idea of encapsulation in programming which is why I’m a big fan of being able to collapse graphs for reuse.
I started by creating a new graph and named it multiblend tool. Next I placed a blend node and connected three inputs color nodes into the pins. The maps were for the foreground, background, and mask pins in the nodes. I named the inputs, labels, identifiers and groups which is good for organization and identifying controls. I repeated the process until I had eight blend nodes connection resulting in a single output.
I wanted to give parameters, so I have control when using the tool. I exposed the blends opacity and blend patterns. Next I changed the blend controls from a slider to a drop-down menu. The drop-down menu doesn’t default to the different blend options available to the node. I had to add options and manually type the eleven options for blending. I repeated this process for each blend node within the graph.
Right now, the user would see all eight input pins when using the multi blend tool. I wanted to be able to change the number of pins based on the amount need. First, I made a custom input parameter changing the value to integer1 and set it to a sliding value. Then I named the identifier, label, and group to “foreground.” The label is particularly important because it is used for the variable in scripting.
In parameters there is an area labeled “visible if.” As the name suggests this is where you can control whether the value is visible to a user or not. Substance Designer scripting for my purposes is straight forward. An example would be input[“param”] ==1 which would mean if an integer value equals 1 then it wouldn’t be visible. So, I applied this to each input node within the multiblend tool graph. So, I would have input[“foreground”] >= 0 and increment the value by one for each input node. This way the higher the integer value the more input pins would show but the lower value you would have less pins.
This is my first experience with any type of scripting within Substance Designer. I would have to say it was simpler than I thought it was going to be. Originally, I was going to make a grayscale version for blending heightmaps, but I ran into blend nodes not blending grayscale images. In a future iteration I’m going to solve this blending issue to give my multiblend tool more functionality.