Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Coloring a vertex in custom mesh component

After following the custom mesh tutorial that rama wrote: https://wiki.unrealengine.com/Procedural_Mesh_Generation Then adding color to it, with much guidance from the forum posts https://forums.unrealengine.com/showthread.php?1552-Generate-Procedural-Mesh

I havn't been able to colour the verticies, something in Opengl ive found an easy task. The reason I want to do this, is to make a custom lighting (based on the height, sun position, etc)

Here is a screenshot of the problem, the vertex colour values I create in the custom dynamic mesh are set to (255,0,0), however the colours never change when I change the variables. alt text

Product Version: Not Selected
lightingerror5.jpg (513.2 kB)
more ▼

asked Aug 31 '14 at 06:49 PM in C++ Programming

avatar image

1 2 5 5

avatar image Deus0 Sep 12 '14 at 12:05 AM

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. alt text

alt text

avatar image Thumper Mar 30 '16 at 02:09 PM

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

 UProceduralMeshComponent* mesh;
 mesh = CreateDefaultSubobject(TEXT("ProceduralMesh"));
     RootComponent = mesh;
 //Set the material
 mesh->SetMaterial(0, Cast(StaticLoadObject(UMaterial::StaticClass(), NULL, *FString(UISC::florMTLoc + materials[0]))));
 //Fill the arrays up with vertices/ and then fill the face array....
 //Call CreateMeshSection
 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?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question