Page Info
Skill Level:
Engine Version:

Creating Material Functions

Choose your OS:

Creating Material Functions

You can create new material functions within the Content Browser by clicking and choosing Add New > Materials & Textures > Material Function. This will open up the new material function within the Material Editor.


By default, your new function will only have a single output node labeled Result. You may now create any network of nodes and connect them to this result.


If you require an input into your function, you will need to create a FunctionInput node. Do this by right-clicking within the Material Editor and choosing Functions > New Function Input.


Your input node is now in place, and you are ready to create any network you like to process that input and feed it back out to the output.


Functions define their interface to any materials they are used in by function inputs and outputs, which are just nodes that you place in the function. Inputs and outputs can be named so that people using the function in their materials know what they mean. There must be at least one output for a function to be valid and input and output names must be unique.

Publishing Your New Function

In order to make the most out of your function, you will need to make sure that it shows up within the Material Function Library, available in the Material Editor. In order to do this, you will need to make sure that the Expose to Library property is set to true. This is done like so:

  1. Deselect all nodes within your function. This will bring up the function's base properties within the Details panel.


  2. Add a description. This is critical, as putting a description here will cause that description to appear as a tooltip when users mouse-over the function in the Material Function Library, as well as when they mouse-over it in the Material Editor. Adding descriptions to your Input and Output nodes is certainly good practice, but if you had to choose only one area to comment in your expression, this is by far the most important one!


  3. Add and set the appropriate categories for your function. You can add as many as you wish, as it is possible that your function might serve well under multiple category headings. However, it is wise to be as concise as possible and not to add any more categories than absolutely needed.