How to set float or float4 UV in Mesh.

Hello. I’m trying to create a shader that supports an outline. My approach is to assign barycentric coordinates to each triangle of a face. These are 3 dimensional.

I know Unity’s UVs support float3 or float4. Is there a way that I can pass that to the Mesh? If not, do I have to create my own Mesh-like data structure that communicates directly with the shader?

Thanks!

Ok, progress. Unity - Scripting API: Mesh.uv misled me into thinking that 2D UVs were the only option with meshes.

I’ve found Unity - Scripting API: Mesh.SetUVs now, which suggests that isn’t the case! Will post here again if I have trouble using it.

Hope it helps someone who was confused by the documentation page too.