Announcement

Collapse
No announcement yet.

Triangle color is not displayed correctly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Triangle color is not displayed correctly

    Hey guys!

    I am trying to render a triangle using UProceduralMeshComponent.
    Even though I setup vertex colors, the triangle is rendered as gray.
    I have rebuilt lighting.
    Code:
    int32 SectionIndex = 0;
    TArray<FVector> Vertices = { FVector(0.0f, 0.0f, 0.0f), FVector(0.0f, 0.0f, 40.0f), FVector(0.0f, 40.0f, 0.0f) };
    TArray<int32> Triangles = { 0, 2, 1 };
    TArray<FVector> Normals;
    TArray<FVector2D> UV0;
    TArray<FColor> VertexColors = { FColor(255, 0, 0, 255), FColor(255, 0, 0, 255), FColor(255, 0, 0, 255) };
    TArray<FProcMeshTangent> Tangents;
    bool bCreateCollision = true;
    
    ProceduralMeshComponent->CreateMeshSection(SectionIndex, Vertices, Triangles, Normals, UV0, VertexColors, Tangents, bCreateCollision);
    What could I be wrong? Do I need to set a material for the vertex color? I am not able to find one in the documentation.

    Thanks!
Working...
X