Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Mesh missing UV2 or UV3 on Android

Discussion in 'Scripting' started by faustus67, Feb 19, 2020.

  1. faustus67

    faustus67

    Joined:
    Apr 15, 2014
    Posts:
    14
    Hi,

    I have some code that uses the UV2 coordinates of a mesh.

    When I access the mesh from script in the editor's run mode I can see I have an identical number of UV and UV2 coordinates.

    When I run the same code in Android I see the correct number of UV coordinates but a Zero length array for the UV2 coordinates. I tried UV3 as well just in case but it came in Zero length as well.

    Code (CSharp):
    1.  
    2. MeshFilter meshFilter = meshRenderer.GetComponent<MeshFilter>();
    3. Debug.Log(string.Format("Found {0} UV and {1} UV2 on {2}",
    4.                     meshFilter.mesh.uv.Length,
    5.                     meshFilter.mesh.uv2.Length,                    
    6.                     meshFilter.mesh.name));
    7.  
    Is there a limitation on the mesh system on Android that just drops the UV2 coordinate array?

    I am using Unity 2019.2.20f

    Any help gratefully received.
     
  2. faustus67

    faustus67

    Joined:
    Apr 15, 2014
    Posts:
    14
    For what it's worth the uv2 coordinates are zero length on IOS as well. This leads me to bepievevsome kind of intentional optimisation is happening. Hmmm