Hi,
Switching the ObiSkinnedClothRenderer tangent space update to "Copy normals from simulation" circumvents the issue. Will take a look at why transforming tangents does not work in Android, but for the time being this is simple workaround. All other tangent update modes work fine too, only the "Transform normals and tangents" mode results in this issue.
"Transform normals and tangents" should not be needed unless you have hand-authored your mesh tangent space, or have specified per-face normals for hard edges.
Edit: Found the culprit.
Turns out, there's this flag in Unity that I didn't know about:
https://docs.unity3d.com/ScriptReference...1583224178
When enabled, it removes unused mesh data at
build time. It's called "Optimize Mesh Data" in the player settings. Unless you're using a shader that makes use of normal maps (which require a tangent space to be defined), Unity
will remove all tangent vector information from meshes in your build. Since Obi assumes the mesh will have both normal and tangent data, and Unity does not know that the tangent data is used by Obi, it tries to access a tangents array of length 0 resulting in the above issue. Unity's documentation does warn that if you enable this flag and do any kind of runtime shader/mesh processing, you can get unintended results.
This does not happen in the editor, because data is stripped only in the build.
Simply adding a check in Line 126 of ObiClothRendererBase:
Code:
if (meshVertexIndex < restTangents.Count)
{
Vector3 tangent = space.MultiplyVector(delta * restTangents[meshVertexIndex]);
clothTangents[meshVertexIndex] = new Vector4(tangent.x, tangent.y, tangent.z, clothTangents[meshVertexIndex].w);
}
Allows support for enabling stripUnusedMeshComponents.