Is there a way to setup a material to have a parameter of type material?

The idea is that I want to have a tile-able brick wall (or floor) that has mold, lava etc on it. I was wondering if there was a way to simply have a parameter on the material so that when I create an instance of it I can decide what kind of material I want (the grunge, FXs, whatever really) to throw on it.

Hi Aiden,

Thank you for your question. Unfortunately, what you are describing is not possible in this build. It would require a function that would take input from a layer, parametrize it and then be manipulated by a kind of material variable.

I wonder if its worth the overhead? Also do the layers get called at render even if there is nothing in the alpha?

Yes, when using layers, the renderer will still have to “check” each texture and render the alpha accordingly. Using layers would be a very heavy way of accomplishing what you are attempting to do, so you may be better off with individual material assets and instances.

Thank you,

Alexander

Dear Aidan,

I was going in a similar direction with this, and so I asked the Fabulous Epic Folks about using material layers, and having a material function as a parameter, end result is having a optional /variable material that you could use as a parameter and layer unto another material

Here’s the answer I got

https://rocket.unrealengine.com/questions/7862/feature-request-converting-material-function-calls.html

(short answer is, no)

#Way to Your Goal

You CAN however use a series of material layers and a series of Alpha scalar parameters to switch between different overlays on top of your base material.

Effectively enabling you to choose between having a mold, or lava, or ice layer, or even a BLEND of fire and ice!

so simply

  1. make a series of material layers
  2. make their alpha values into scalar parameters
  3. decide upon your system of switching between these alphas to switch the material layers

Rama

Hmm… I didn’t think about compilation makes sense… Have you tested out such a large chain of material layers I wonder if its worth the overhead? Also do the layers get called at render even if there is nothing in the alpha? Might just be worth spending the time to make a bunch of materials instead and just try to re-use as many material layers as possible.

Thanks for the intel Rama,

Aidan