I am making a mobile game where obviously performance is always a concern. I see when you import an image and set it to a Sprite, you get the option to choose it’s Mesh Type. Full Rect or Tight.
Full Rect : Rectangle mesh equal to the user specified sprite size. Tight : Tight mesh based on pixel alpha values. As many excess pixels are cropped as possible.
In other worse, Full Rect is 1 big quad (rectangle) that wraps the entire image. It will include any transparency around the edges. Tight will use many triangles to almost go around the edges of your image to limit the amount of whitespace/transparency included.
I have read that Full Rect will have a lot less triangles whereas Tight will have much more. The advantage to Tight is there will be a lot less overdraw and alpha blending (it doesn’t need to draw/calculate empty alpha pixels.
Some sites I read claim for mobile to just use Tight as Alpha Blending and Overdraw is expensive. I am not sure changing every single sprite in my game to Tight is the best option. What about images that are square in size and have little to no transparency around the edges? Seems to make sense those I’d leave at Full Rect.
Well, unless I am missing something, I need to make everything a Full Rect. Since I use Unity’s Sprite Sheets, the Tight mesh type seems to grab parts of adjacent sprites (you can see parts of the other sprites around the edges).
If anyone has any solutions or experience in this area it would be appreciated!
In general, overdraw is bad for performance on low-end devices and some mobile devices will fall into that category.
By default when you import your Sprites into Unity, they should have their Mesh type set to “tight” so you shouldn’t have to change anything.
In that case you would probably be better off with a quad. If you want to do some micro-optimisation you could even draw an outline yourself in the Custom Outline section of the Sprite Editor.
Can you share how your Sprites are laid out in the Sprite sheet?
Ya sure. So if I change some of my game icons to use a “tight” mesh type, this is how it shows up in my game :
Those red bits under my arrow icon should not be there. They are part of a different image in the sprite sheet (I assume)
I am trying to find out how to see the Sprite Atlas Unity creates for me, but the “Pack Preview” button doesn’t seem to do anything (It used to show a zoomed in view of the sprite sheet, doesn’t anymore, not sure why)