Making Material Parameters

Choose your OS:

To interact with Material Instances, you need to use a special kind of Material Expression node called a Material Parameter. In this How To, we will be looking at how you can add or convert Material Expression nodes into Material Parameters nodes and also how you can use those Material Parameters nodes inside of your Materials.

Parameters

Material Parameters are a special kind of Material Expression nodes that allow you to change the look of a Material without having to recompile the Material to see the effects. Material Parameter Expression nodes work like any other Material Node that you might use in the Material Graph but with one key difference. When the Material has been compiled and used as a Material Instance, the parts of the Material that use Material Parameters as inputs can then be adjusted, in real time, allowing you to completely change the look and feel of the Material without having to re-compile the Material. You can even adjust Material Parameters while the game is running allowing you to dynamically change how something looks based on certain game rules.

Creating Parameters

You can create Material Parameters in the following ways inside the Material Editor.

Right-Click Conversion

The simplest way to make a Material Parameter out of a Material Expression is to Right-Click on an existing Material Expression node and then choose the Convert to Parameter option from the menu if available. Once converted, you can then name the Material Parameter and give it a default value. To make things better organized, you can also give your Material Parameter a Group. A Group will group Parameters with the same group inside of Material Instances, making it easier to see Parameters that go together.

Not all Material Expressions can be converted into Material Parameters. The best way to see if a Material Expression can be converted into a Material Parameter is to Right-Click on it and check to see if the Convert to Parameter option is available. If you do not see the Convert to Parameter option, then the Material Expression cannot be converted.

Adding Parameters from the Palette

You can also add a Material Parameter from the Palette search menu. To do this, first search for the word Parameters in the Palette search menu. Then select the Material Parameter you want to use with the Left Mouse Button and with the Left Mouse Button still held down, Drag the Material Parameter you want into the Material Graph, releasing the Left Mouse Button when your mouse pointer is over the Material Graph to add the Material Expression node in the Material Graph.

Adding Parameters from the Right-Click Menu

You can also add Material Parameter Expression nodes to the Material Graph by Right-Clicking on an empty section of the Material Graph to display the search menu. Once the search menu has been displayed, search for parameters using the word Parameters as the search term. Once the Material Parameter node you want to use has been located, select the Material Parameter Expression node from the search menu with the Left Mouse Button and then press the Enter key to place the Material Parameter node in the Material Graph.

Using Parameters

You use Material Parameters like you would use any other Material Expression inside your Material. Where the real power of Material Parameters comes into play is when you use them in conjunction with Material Instances .

  1. First find and add the following type and amount of Material Parameter Expression nodes to the Material Graph.

    • Vector Parameter x 1

    • Scalar Node x 2

    You can add either Material Parameter nodes or Material Expression nodes. If you do use Material Expression nodes, make sure that you convert them to Material Parameter nodes via the Right-Click menu after you have selected them.

  2. Next, make sure that all the Parameter nodes have names and default values. For this example, we are using the following names and default values.

    • Base_Color R:1.0 G:0.0 B:0.0

    • Metallic 0.0

    • Roughness 0.5

  3. Once everything is named, connect all of the Parameter nodes into their respective inputs and make sure to compile and save your Material.

  4. Now that the Material is compiled and saved, close the Material and find it in the Content Browser. Once you find it, Right-Click on it with the mouse and select the Create Material Instance option to create a new Material Instance from the Material.

  5. Open the newly created Material Instance by Double-Clicking on it with the Left Mouse Button in the Content Browser. Once the Material Instance is open you will be able to edit, in real time, the parameters that were set up and named inside of the Material like Base_Color, Metallic, and Roughness.

Conclusion

Material Parameters are a very powerful and extremely useful tool that when combined with Material Instances offer you a way to add an almost endless amount of variation to your Materials. However keep in mind that in order to use Material Parameters you have to use a Material Instance.

Tags