ara

  • prije 10 dana
  • Pridružuje se 14. tra. 2018
  • 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.

    • ara se ovo sviđa
  • ara Ah, that's right. The Layered option was added in 4.1, so it cannot be used in 4.0. We apologize for the inconvenience, but we have made a lot of improvements in Spine 4.1 and 4.2, so we would appreciate it if you would consider upgrading.

    • ara se ovo sviđa
  • @ara Please note that it's in general recommended to use binary .skel.bytes skeleton export instead of .json format, since the binary export results in reduced file size and load times.

    If you have loads of skeletons that need modification, another way could be to write a custom SkeletonDataModifierAsset which upon each import iterates over all animation's Timelines and if it's a RGBATimeline, access the Frames property and check and modify the alpha value accordingly.

    An even simpler fix would be to change the line frames[frame + A] = a; in Animation.cs to e.g. frames[frame + A] = a > 0.995f ? 1.0f : a;.

    • ara se ovo sviđa
  • @ara No, it won't break batching then, quite the opposite - passing information via vertex attributes while using the same Material is the way to allow batching. 🙂

    • ara se ovo sviđa
  • ara Will extra variant uv2 per-skeleton data break batching or SRPBatcher?

    Using a different shader will definitely break batching. It does not matter whether you use additional vertex attributes at this batch or not.

    ara Is it better performance to split r2g2b2 data into Vector2 uv2,uv3 instead of storing them in a single Vector4 uv2?

    The main problem is that Unity's old Mesh API did not provide any option to pass higher dimension data than a Vector2 as UVn attributes. The newer Mesh API now allows to specify custom vertex layouts, but it's only supported in Unity 2019.3 and newer.

    It should not make a measurable difference though to use two float2 attributes (which likely really end up as two streams) instead of one float4.

    • ara odgovara na ovo.
    • ara se ovo sviđa