- Home /
Circular Mesh UV interpolation for tileable texture
Hi,
I have a circular ring mesh which I have generated procedurally. I also have a tileable texture which I want to place onto it. I have assigned UV coordinates to each vertex. This works for the most part but where the circle "closes" I get my whole texture squashed and mirrored between the last and first column of vertices:
I have set the indices so that the last and first triangle share the same column of vertices (0 u coordinate). I was hoping that the triangle's UVs would be interpolated forwards from 0.95 -> 1.0/0.0 without interpolating all the way backwards. Is this actually not possible?
The only solution I can come up with is to duplicate the first column of vertices and set their u coordinate to 1.0. In order to retain the smooth appearance I guess I would then have to manually set the vertex normals too, which currently I am not doing as the Mesh.RecalculateNormals() function works fine.
Many thanks, Simon.
Answer by Acegikmo · Apr 29, 2020 at 01:16 PM
Like you say, you have to duplicate the vertices, since it's kinda in the nature of how UVs work! And yes, set the normals manually too if you want the seam to share normals
You could also map the texture using math in the shader instead of UV coordinates, in case it's circularly distributed, though it gets a little tricky if you want to deal with mipping properly at the seam :)
I feared as much - I don't think I'll try the shader method. Thanks!
Your answer
Follow this Question
Related Questions
Vertex Colors not smooth enough? 0 Answers
Unity Materials and UV coordinate help 3 Answers
uv Tiling y error 2 Answers
Does CombineMesh always remove unused vertecies or not? 0 Answers
Update a texture at runtime using UV 0 Answers