In header file of ProceduralMeshComponent we have the following description of class methods:
/*
* Create/replace a section for this procedural mesh component.
* @param SectionIndex Index of the section to create or replace.
* @param Vertices Vertex buffer of all vertex positions to use for this mesh section.
* @param Triangles Index buffer indicating which vertices make up each triangle. Length must be a multiple of 3.
* @param Normals Optional array of normal vectors for each vertex. If supplied, must be same length as Vertices array.
* @param UV0 Optional array of texture co-ordinates for each vertex. If supplied, must be same length as Vertices array.
* @param VertexColors Optional array of colors for each vertex. If supplied, must be same length as Vertices array.
* @param Tangents Optional array of tangent vector for each vertex. If supplied, must be same length as Vertices array.
* @param bCreateCollision Indicates whether collision should be created for this section. This adds significant cost.
*/
Now I am confused - why does Normals array is the same size as Vertices array, instead of Indices? Here is how I understand mesh rendering - when we get basic shape from vertices and indices, we would like to have also map of normal vectors - every triangle have at least one normal vector, if we want to simulate some depth, we could apply linear change of normal vector from one triangle vertex to another. If I would design library for mesh processing, my first decision would be to make Normals array in the size of Indices array (here described as Triangles). Of course it can be wrong - but I want to know why. When I make Normals array in the size of Vertices array, I decide that every Vertex have one and only one Normal vector. Every vertex is used by at least two different triangles, which in general don’t face the same direction. So one vertex participate in having two (or more) Normal vectors.
The only argument for actual solution I can think of right now is the sake of size (which is also important). We have much more indices than vertices, so even losing some data from used solution we can get some additional computing time.