Why is there a MeshUtility.SetPerTriangleUV2

According to the Unity script reference:

For every vertex there can be a
normal, two texture coordinates, color
and tangent.

According to Wikipedia, (and I know this is the case in OpenGL).

UV coordinates are applied per
face,[3] not per vertex. This means a
shared vertex can have different UV
coordinates in each of its triangles,
so adjacent triangles can be cut apart
and positioned on different areas of
the texture map.

Unity seems to support this through MeshUtility.SetPerTriangleUV2. Why? Why can I not set per-triangle uv coordinates for the primary texture?

Just found your question. MeshUtility is an editor class and SetPerTriangleUV2 isn’t documented or has been removed, so it’s probably used internally by the editor.

Next thing is the graphics card can only use one index for all “vertex parameters”. I worked a lot with OpenGL in the past but mostly with the immediate API :wink: However I’ve never heard of a way to specify the uvs seperately when using indexed buffers. See this SO question.

I guess the function is used by the lightmapper for specifying the lightmap UVs.

Fact is that you have to split a vertex when any vertex property is different (position, normal, color, uv, uv2, tangent)