Creating Material Functions

A guide to the creation process for material functions.

Windows
MacOS
Linux

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.

CreateNewMenu.png

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.

NewResult.png

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.

AddInput.png

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.

SampleNetwork.png

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.

    ExposeToLibrary.png

  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!

    BaseDescription.png

  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.

Tags

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback