ara Do you think it is possible to get/calculate a float t value (y axis per attachment rect) from any existed APIs ?
We can modify the MeshGenerator code then write t value into uv2or3 without caring wrinkles.
It is possible, but rather tedious, and when using clipping it becomes even much more complicated.
In order to get the initial uv coords (from which you need the y coord) before applying the atlas-mapping, you would need to access each MeshAttachment
's regionUVs
array field (containing float u
and v
of each mesh attachment's vertex), or in case of RegionAttachment
you can assume the vertex order being: bottom right, bottom left, upper left, upper right. See RegionAttachment.ComputeWorldVertices and MeshAttachment.
So in order to avoid this, the alternative solution using automatically generated images would be much less effort and more flexible.