Jump to content
  • Advertisement
Sign in to follow this  

Unreal Triangle color is not displayed correctly

Recommended Posts

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.

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.


Share this post

Link to post
Share on other sites

Are you using correct shading material that utilize vertex colors display? Vertex colors are not usualy used for actual color, but often it is textures blending etc.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!