I figured out the problem…
It had nothing to do with the code, it was that the material did not use the vertex colour data. (I was used to the default behaviour being vertex colour is used, not exactly sure how the default material behaviour is in ue4)
Also there should be a way to do this with different variables, not just colour component. Material properties etc. Not exactly sure how atm.
I’ve been trying to get this to work and I’m confused about if I’m starting the procedural mesh the right way. I use CreateMeshSection on my proceduralMeshComponent object. It takes an array of verts/ faces, and some other stuff too. My procedural mesh spawns in my level, but does not have the material I apply to it. I’ve also tried doing the vertex colors material you post above and it’s not rendering the red color it should be (still just grey).
Am I starting the procedural mesh the right way? I see above you use GenerateMeshSceneProxy. What is the order of how you spawn this object? For me it’s
mesh = CreateDefaultSubobject(TEXT("ProceduralMesh"));
RootComponent = mesh;
//Set the material
mesh->SetMaterial(0, Cast(StaticLoadObject(UMaterial::StaticClass(), NULL, *FString(UISC::florMTLoc + materials))));
//Fill the arrays up with vertices/ and then fill the face array....
mesh->CreateMeshSection(2, noWalkVerts, noWalkTris, pathNorms, pathUVs, noWalkColors, pathTangs, false);
This gets me to where the mesh is spawning in the level. I can see the prescribed material listed in its details panel, but still it is only grey. Any ideas?