Using MESH ATTRIBUTES in Materials

Hello, I’m pretty new to Unreal, coming from Houdini and Pixar’s RenderMan.

Usually when setting up especially more complex materials, I use mesh vertex float type attributes to drive material masks.
Especially, for layered materials this is extremely beneficial and kinda essential in my workflow.

As I can’t find a material node which appears to pull attributes from meshes in Unreal, I’m kinda struggling to imitate this workflow.
If anyone has any experience with this or has any ideas at all on how to go about this, I’d be really grateful for any input at all.

Thank you very much for your time and help! I appreciate it!

to add custom attributes you’d have to write a custom shader.

the “default” techique for vertex “mask” data is using the vertex color. you basicly have 4 “floats” available for whatever you wanna do. in the source it is specified as 8-bit precision srgb. that’s a lil counter intuitive for non-color blending operations, but you could convert it to linear space in the material shader. and ofc you can crunch more data into it if you use bitpacking or shifty shader math.

I have looked into the “Vertex Color” node before, but I can’t seem to figure out how to choose which attribute exactly it uses?
As my geometry (USD files) get imported with multiple vertex attributes which all differ in name.
I also am not sure Unreal even recognizes them correctly. As they don’t seem to be recognized as vertex color in the same way, the documentation explains the usage for manual vertex painting.

I can’t seem to find any examples or setups which use geometry from different software like Houdini or Blender and then use such attributes to drive blend masks for materials.
If you could point me in the right direction for examples or documentation of this, it would be extremely helpful.

i’m not aware of documentation. i know it works for blender imports tho. demo snapshot of the very application.

if you use attributes in blender (this is 3.6.5) you could write a python script and convert 4 attribute channels to a combined vertex color that unreal guaranteed imports and handles correctly. not sure rn how 4.x does that. it doesn’t have the color seperated anymore. i reckon the scripting thing would be the way to seperately author and combine before export. the workflow.

I see, thanks for clarifying your initial post, that helped a lot.
The way you described it appears to work only with the color attribute?
Not with any custom attributes which have nothing to do with the object color?
If so, this workflow doesn’t work for me, as I need more than 4 channels / types of attributes which drive various material aspects.

Is there any sort of node or way which lets me pick exactly which attribute I want to get data from? So I’m not limited to what’s stored only in the vertex color attribute.

not that i’m aware of. the vertex data format for rendering has limitations what the gpu can handle at once. this is realtime rendering not an offline computation.

if you can read code…

no room for attributes. they are not even imported. only the color is used. so… if you want some of that functionaility you gotta blueprint cheaty shaders to get it done within limits.

an alternative i could suggest is to bake low res textures of the “vertex attribute data” and/or convert it into uv data and do shader magic. you can have 8 uv sets (upto 16 channels) for static and 4 uv sets (upto 8 channels) for skinned meshes. that’s in line with what naughty dog does with their procedural material system. you can look it up on google.