Help with Decal Renderer component on Niagara

Hi this is the second time I come with the same problem, I made this set up on niagara for getting the decals spawn as Scene component renderer, but now I am using mutiple component renderer for different decals, I want to know if anyone knows a better way to get different decals without having to use different renderers.

1 Like

I don’t think there is a native way at the moment unfortunately. As we cannot bind to the material property to change it.

What you can do is, create your own Blueprint component that inherrits from DecalComponent, then use that one inside Niagara.
Then inside this custom component, add all your decal materials into an array. And on Construction/BeginPlay set your decal material depending on a custom integer variable.
Make the variable public and it should appear in Niagara and you should be able to bind your ‘Visibility Tag’ to it.
Haven’t tried this, but in theory it should work.

2 Likes

Great answer I am quite new to blueprints do you know where I can get information on how to create that type of Blueprint?

When you spawn multiple meshes in one emitter you can setup a mesh index to select the different index numbers after adding a few different meshes to your mesh renderer. The mesh index allows the single emitter to choose from a random mesh index of 0-1-2 or however many you’re trying to spawn. Is this also possible for decal’s?

Fyi, in 5.2 they added a Decal Renderer. That one has a material binding property, so you can create a UserParameter and bind to it. Then you can switch material per system when needed :slight_smile:

1 Like

Great catch Tobias! You think you can show how this would work? I am interested in using this in a future project and the material parameter binding is awesome!

In my current project, we use the visibility tag to randomly select between decal renderers of different variation. Personally I think using an atlas texture and a user parameter to select the desired tile would be more efficient (my decals use clamped wrap mode), unfortunately I don’t have the final say in which method to use.

1 Like