How to change the vertex color layer

Hello!

I am using Blender to write a procedural mesh / procedural color add-on which creates low poly planets and uses the vertex colors (instead of textures and uv-maps because the automatic generations of uv-maps are ugly). The generated planet has more than one vertex color layers (one for the actual color, one for the roughness, one for the metallness (as you can see, physically based rendering)).

Now I hoped I could import the fbx-file and generate a material which uses vertex color layer A for diffuse color, B for roughness and C for metal. But the vertex color node doesn’t allow me to set a different layer.

How can I do that in UE4?

Thanks!

Hmm…
so if im getting this right… you want to give vertices more than one vertex color?
because I dont think thats possible.
Well… I know its not possible.

It is possible and supported from the fbx file format. As you can see in blender, for example, is the possibility to use more than one vertex color layer.

But the statement “…vertices more than one vertex color” is also wrong, because a vertex has one vertex color for each face he is part of (because you can have faces which are blue, the next one red and you don’t want interpolation between the edge). Normally when you use vertex paint mode you don’t see this, because you are coloring everything the same. But when you colour it with a algorithm you can do that.

There was the same question for Unity which, in fact, doesn’t support that also. multi-layered texturing / multiple vertex color sets - Unity Answers

Aaaand you can see here that assimp also supports importing fbx with more than one vertex color set/layer.

https://github.com/assimp/assimp/blob/master/code/FBXMeshGeometry.cpp#L321

UPDATE

I searched the UE4 sources and found this: https://github.com/EpicGames/UnrealEngine/blob/8a80b5541f69a79abf5855668f39e1d643717600/Engine/Source/Editor/UnrealEd/Private/Fbx/FbxStaticMeshImport.cpp#L354 I think that shows that UE4 is only importing the first layer and ignores the rest.

You can also export a imported mesh (from Blender with x vertex color layer as fbx in UE4) as fbx file and only the first vertex color layer is there. I hope this will be added. Breaks the ability of using UE4 for my master thesis.

I meant its not possible in ue4.
Please dont add content I didnt say :slight_smile:

Sorry, doesn’t should sound harsh. Just had this situation in the past “that can’t work, that’s not possible, …” and wanted to show that it’s in fact possible but not implemented.
Any Idea how I could add that?

No Worries :slight_smile:
Can you tell me why you need the different layers?
why wouldnt you use the same layer (or perhaps different UV-channels) for albedo, roughness, metal ?

As stated in the question I am procedurally generate a planetoid. The low poly planetoid can have lots of spikes and automatic uv mapping isn’t satisfiying (because the algorithm is finding lots of seams, which generated lots of islands and makes LoDs difficult). So I thought I could use vertex colors for albedo. I feel silly never tried using UV-Channels for roughness and metal. After a short search I also found out that the texcoord-node supports the ability to set the uv-channel-index (Can you use a second UV set for a second texture map? - Rendering - Epic Developer Community Forums). Thanks for the nudge :wink: