Download

Is it possible to pass 2 different float 4 values through one connection?

Hi, I have 4 different sets of UV coordinates that I wanted to send to a material function without having 4 different inputs, since I have the same material function for every texture in my material, so that would be a lot of connections.

currently I appended two UV sets into a vector 4 two times, so I have only two inputs in my material function, and inside the function i break them up with two BreakOutFloat4Components, but I was wondering if there’s such thing as a “breakout float 8 component” or if I could make that with a custom function?

thanks

How about Material Parameter Collections | Unreal Engine Documentation

Hey, thanks for replying.
Hmmm I don’t think it does what I need?
Here’s an example (not my actual material, just something I put together to demonstrate:

so what I want is to group up all those UV sets so I can have only one line and only one input in my material function, and I would do the unpacking inside the material function.

It would make my main material graph so much cleaner. In the actual thing I have like 8 of the same function for each texture map, and each function has 13 inputs, so it’s getting out of hand

Ah OK, I see.

How about use MakeMaterialAttributes in a MaterialFunction to pass all your UVs into the Customized_UVs (you get 8 sets!). Then use BreakMaterialAttributes in your other MaterialFunctions to hook up the relevant UVs.

1 Like

Oh! I didn’t know the material attributes node had multiple UV nodes inside a function! I suppose this will work great, thank you!

Edit: It did work perfectly, but now I’m wondering, is there a similar way to pass multiple bool values? It looks like the material attributes’ inputs don’t take bools and I’m not sure if it’s possible to convert them into floats and back.

You could append the bools into vectors, then use Mask to seperate them out.

I tried this one but I suppose appends only accept float values, not bools

Hmm… this would be trivial in blueprints, but seems tricky in materials. The only option I can think of is to use the custom node (with HSLS), but that is a real sledge hammer option and so feels wrong to even mention it.

Sorry can’t help on this, but hopefully someone more knowledgable will stop by and chime in.

1 Like