Short: What's the best way to do Sprites that only have opaque pixels, full transparent pixels (0% alpha) BUT no semitransparent pixels? Long: I tried to educate myself on how to do sprites efficiently on Mobile. What i found out so far is that the main performance killers are -Drawcalls (this taught me about batching, atlas, packing tags and how sorting order may break batching) -Number of pixels you draw (increases dramatically with the use of transparent shaders, capped by FillRate) So after stumbling across a lot of threads from 2011 (http://forum.unity3d.com/threads/wh...ch-an-issue-on-mobile-dev.109463/#post-725378) i wanted to know if there is anything new to consider now Use case: A number of my tile-sprites generate mostly quads with 90% transparent pixels. I could match the geometry more closely to cut out most of the transparent pixels but how would this work with animated Sprites like characters? I dynamically generate my blocks with different borders and transition-line-tiles that have a lot of transparent pixels but not semitransparent pixels. This really kills performance as most of them seem to have a lot of transparent rendering going on - if i read the profiler correctly. This is my Block-Template (scaled up by 3) and a use case to see how they are combined and drawn:
SpriteRenderer should generate a sprite mesh automatically and thus cutting off most of the transparent pixels. You can verify this by changing the shading mode in the scene view to "wireframe" or "shaded wireframe".
Thanks for helping me again Kuan! I already checked the wireframe and it seems that my sprites are always getting a quad as mesh, except some stuff like arrow triangles, see picture: The arrows in the pic use a 200 "PixelsPerUnit"-setting while the rest is at 16PxPU. Here are the things i do: -nearly all game Textures (at least all on the picture) are set to compressed with "game" as packing tag -they get packed into 2 atlases, depending on if they have alpha -Character has a SpriteRenderer & Animator -Blocks have empty GameObjects that get their SpriteRenderer & Sprite only at Runtime Anything that breaks tight Spritemeshing? How does PackerPolicy impact on that, it doesn't change anything for me after setting it to tight and repacking.
For your textures with quad meshes, you could try checking if the mesh type is set to Tight or Full Rect. You could do this by: Selecting the texture In the inspector, set the Texture Type to Advanced Check Mesh Type under Sprite Mode and see if it set to Tight.
hmm, doesn't change anything, i also tried to play around with extrude edges (0, 1, 32) - still quads You could check the Testbuild of my previous Question (which is resolved): http://forum.unity3d.com/threads/sorting-order-breaks-batching.334048/#post-2164006 This seems to address those issues? https://www.assetstore.unity3d.com/en/#!/content/37599
Based on your project, the mesh defaults to Full Rect as the tiles are too small (16x16). Tight mesh type requires the sprite to be at least 32x32 in dimensions. Is your character size similar in height and width to the tiles in your test build?
Yes, everything very tiny and pixelated 16x16, 16x32 I guess i have to check if spritesharp can deal with those resolutions, thank you for your help!