Hey!
I´m currently working on a small environment and trying to build a master material for decal work.
I´d like to have control over which PBR channels are applied unto the surface on which the decal is projected. IE, cracks on normal only or smudges and fingerprints on roughness. But I´m encountering some problems.
Creating and using a decal material out of the box gives me the behaviour I want, only projecting whichever texture maps are connected.
However, as soon as I convert it to a reusable Master for instancing, it is no longer “Not connected“. Thus projecting whichever texture was set as default in the TextParameter. Even if “Blank“. Trying to use StaticSwitch Parameters to toggle them on or of only causes errors since the False condition cannot be left empty.
Next approach was setting the properties via Material Attributes. This went better but I’m still getting some strange results.
This setup uses a MakeMaterialAttributes node as a “Blank” template to start building on. Each of the Material function nodes has a static switch which dictates if said property is applied via “SetMaterialAttributes”, or if the blank gets passed through.
This way we circunvent the “empty” conditions while also leaving those properties with both a connected and disconnected state.
Which sort of works, except for the BaseColor, the Roughness and partly the Normal, since it´s not applying new info but rather removing the underlying detail.
Here is where I got stuck without knowing where these values are being inherited from. They do seem to come from the empty MakeMaterialAttributes node, modifying them directly changes the colors. But that defeats the entire purpose since I don´t want any information to be applied when toggled off.
Has anyone pulled off something like this?