Using Material Functions in a unique way

I’m looking for this feature for a long time. I guess some users has already asked/posted about this. But I’m trying to point it out more clearly. Material functions has an option called “Prefix Parameter Names” but I’m not sure what it’s doing. Checking/unchecking that makes no difference.

The idea:

It would be great to expose “Prefix” and “Suffix” options for any material function that is called in a material. Then add those prefix/suffix to all containing parameters. Maybe something like this:

Also there can be something else to group all those parameters in a different way.

Even this can be taken one step further, when a parameter is placed in a function, there can be some extra options. Something like this:

So only those parameters will take prefix/suffix if provided in function call and generate new unique parameters. There can be other options also, like override or use group from function call or something like that.

Also new set of parameter nodes can be introduced only for Material functions which will create new parameters like this and keep each function call unique.


With this functionality, it will be more easy and fast to make material containing multiple textures. For example landscape, paintable material, masked materials etc. Like I explained in first screenshot.

If this idea is implemented, I hope many developers can take more advantage of the material function. It will unlock possibilities of DRY development in material creation process.


Why don’t you utilize parameter categories?

Prefixing is a primitive tool to introduce categorization into systems which have no categorization tools otherwise. Unreal does tough.

And it’s much better than prefixes, since it will also arrange the user interface in a manner where the parameters sharing the same category will be visually separated from parameters of other categories.

Something like this:

…is much uglier and shittier than something like this:

@Rawalanche what the OP suggests would *generate new parameters in the instance *each time the function is used with a different prefix. it would be a convenient way to create complex materials that use functions several times and require creating and maintaining a whole set of unique params for each of them.
a common use case is Landscape as he mentioned. if you make your landscape layer nodes into a function with x input params then copy it n times into the material, you need to make x * n unique parameters with their own unique names. imagine then the repercussion of changing something in the function, or maybe having to rename params because you decided to rename landscape layers.
what you suggest does nothing of the like :wink:

in a way the new Material Layers already do that (each param is unique to each ML in the layer stack even though they only exist once in the parent base ML they inherit from). but sadly those don’t support Landscape

Your case is different than what I suggested. Imagine this case,

**You want to build a Landscape material with 10 layers for painting. Each layer should have their own controls. Each layer has at least combination of 10-15 scalar and vector parameters. Each layer has same nodes which you can easily manage with a function. But when you need to expose those parameters, you need to connect all those parameters to function input for each layer again with changing the names. Which is repeating the work.

Now This is how each layer looks:**

Of course I’ve grouped all those parameters by the name “Grass Layer” but still, I’m prefixing them in name because they can mix with other layer’s parameters. So All layers combined look something like this, repeating everything:

Now imagine you have all the parameters set in that function already. There’s an option in material function call to prefix and group parameters inside and introduce new parameters in the material. Just prefix or give a name to group each function’s parameters and make new parameters for each function. It will look much clean and will take a lot less effort. It should look something like this:

I know about material layers but it’s not supported with landscape. Just not this case, there are many other case where this functionality can be useful. Hope you got my point. If anyone can, please tag someone from dev team to take this feature into notice :slight_smile: