- Home /
How to Calculate UV Map and Tangents for Unity Mesh
I have an editor script that removes all the vertices of a specific color, however, when I delete these it messes up my UV Map, and therefore the tangents which cause a mess of problems with the model. Is there a way to (re)-calculate the UV map and tangents, thereby fixing the problems with the mesh? Or is there a better way to solve this?
The UV's can be updated in the same way since they are stored per-vertex. I will add that to the example for you :) The tangents are a little harder to recalculate I think. I will check my notes since I have done this somewhere.
Answer by numberkruncher · Apr 29, 2013 at 01:52 AM
The following forum thread includes a good method for recalculating the tangents of a mesh. I used this in a project and it worked wonderfully:
http://forum.unity3d.com/threads/38984-How-to-Calculate-Mesh-Tangents
Note: I converted this to C#
Your answer
![](https://koobas.hobune.stream/wayback/20220613101207im_/https://answers.unity.com/themes/thub/images/avi.jpg)