Provide alternative inputs to the group node and label the group node ports

You can add a Default Value node to your graph. This way, MyColor provides a default input value, while the user can also provide an alternate input value. If an alternate is provided, it is used. Otherwise, the default value is used.

Adding the default value nodes to the graph

  1. Select Settings > Toggle Advanced Mode from the ShaderFX menu bar to enable advanced mode. This mode provides a larger selection of nodes.

  2. Enter the group view, right-click the work area, and select Graph Nodes > Code Control > Default Value to create a Default Value node.
  3. Connect the nodes as follows:
    • Connect the RGB attribute of MyColor to the Default attribute of Default Value.
    • Connect the Alternate attribute of Default Value to the group node. An Alternate 0 port appears automatically.
    • Connect the Result attribute of Default Value to the Value attribute of Multiply.
  4. (Optional) Create a second Default Value node and connect it to MyMultiplier as follows:
    • Connect the float attribute of MyMultiplier to the Default attribute of Default Value.
    • Connect the Alternate attribute of Default Value to the group node. An Alternate 1 port appears automatically.
    • Connect the Result attribute of Default Value to the Value attribute of Multiply.

Labeling the group node ports

  1. Select the group node. In the Attribute Editor, make sure that Active socket 0 is selected, then add Active socket label MyColor.

    The first port of the group node is now renamed to MyColor 0.

  2. Repeat for the second port. Use Active socket 1 with the Active socket label MyMultiplier.

    The second port of the group node is now renamed to MyMultiplier 1.

Supplying an alternate input value

  1. Exit the group view and create a Color node (Hw Shader Nodes > Values > Color).
  2. Connect the RGB attribute of the Color node to the MyColor attribute of the group node.
  3. This alternate Color node is used instead of the default value.
  4. (Optional) Repeat for the Float multiplier. Create a Float node (Hw Shader Nodes > Values > Float) and connect its float attribute it to the MyMultiplier port of the group node.