UProceduralMeshComponent normals don't work

Hi everyone,

quick question! I used UProceduralMeshComponent presented here, in this tutorial:

Everything works fine, except that normals don’t make any difference in triangle facing direction.

Here is a triangle from tutorial:

TArray<FVector> normals;
	normals.Add(FVector(1, 0, 0));
	normals.Add(FVector(1, 0, 0));
	normals.Add(FVector(1, 0, 0));

And here is the same triangle but with opposite normals:

TArray<FVector> normals;
	normals.Add(FVector(-1, 0, 0));
	normals.Add(FVector(-1, 0, 0));
	normals.Add(FVector(-1, 0, 0));

With changing the normals I would assume the triangle would look like this on the expected side, but I had to rotate camera to make this screenshot:

Because normals are not affected by my code, my cube looks like this:

Can anybody tell me what’s going on? Somehow I can’t debug the code which is inside the CreateMeshSection_LinearColor function. I really appreciate any clues! :slight_smile:

So it turned out this it like in OpenGL for example and triangle winding order is important for culling. Normals are mainly for lighting (which you can see on the screenshots). If you want to invert the triangle mesh, you need to change the triangle IDs from [0, 1, 2], to for example [2, 1, 0], to be counter-clockwise. More info about it from Wikipedia: