RecalculateUVDistributionMetric(int, float)
Recalculates the UV distribution metric of the Mesh from the vertices and uv coordinates.
Read time 1 minuteLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public void RecalculateUVDistributionMetric(int uvSetIndex, float uvAreaThreshold = 1E-09)
Parameters
Remarks
The UV distribution metric can be used to calculate the desired mipmap level based on the position of the camera. It's important to call this function after procedurally generating meshes that have textures that use Mip Map Streaming.
This function can also be used to update the UV distribution metric with an alternative uvAreaThreshold. The uvAreaThreshold can be used to ignore small UV areas from the UV distribution calculation; for example, you may wish to ignore a single texel colour used for a large triangle area. Unity will not consider the density of these areas when calculating mip selection, which may result in some colour tint due to lower mips being selected. The value depends on the texture resolution; for example, for a 256x256 texture, a single texel area would be (1/(256*256)).
Additional Resources: Mip Map Streaming Mesh.GetUVDistributionMetric, Mesh.RecalculateUVDistributionMetrics.