AlpakaJoe
AlpakaJoe

Reputation: 593

Fastest settings for Sprites (2D and UI)

what are the fastest settings here:

https://docs.unity3d.com/Manual/TextureTypes.html#Sprite for Sprites (2D and UI)?

With fastest I mean, what are the settings that cost less power for cpu / gpu / ram / whatever.

the sprites i have are 32x32, if that is important.

Upvotes: 2

Views: 1586

Answers (1)

580
580

Reputation: 480

TL;DR - Most these settings have little to no impact on performance more on quality or content/layout. Your performance is going to come more from how you structure your project.

  1. Texture Type - In this case it is fixed to Sprite (2D and UI)
  2. Texture Shape - Obviously locked to 2D.
  3. Sprite Mode - This depends on whether or not you're using a sprite map. Meaning keeping multiple sprites (or components of a sprite) together in one image. You'd either have this set to on or off based on what the image contains for content. It depends on exactly what you're trying to do here, but sprite maps can be used efficiently for animation if needed. They can be used to break down components of a sprite such as eyes, arms, legs and etc. then an overlay can be used to animate the sprite. It can also be used as a way of storing multiple sprites in one image, though I don't think you're after this.
  4. Packing Tag - Can be used with sprites to identify the sprite's packing/batch group. Sprite packing is something you want to investigate. Unity - Sprite Packer
  5. Pixels Per Unit - Is kind of the only other place in which you may care about as it affects the physics engine. This setting again depends on your project, but in your case leaving the default setting is probably best, but 32 would probably be fine. I don't think it will have much of an impact.
  6. Mesh Type - Due to the fact the image is 32x32 you're forcing the full rect option here.
  7. Extrude Edges - Has little to no bearing on performance.
  8. Pivot - Has little to no bearing on performance. Unless there are certain algorithms in your scripts that must be run where a particular coordinate system/layout matter. Highly, unlikely to have an impact on performance, more of an impact on your algorithms layout.
  9. sRGB - Can affect how the shader will handle the image, but again due to image content your pretty much forced to choose one or the other.
  10. Alpha Source - Leave this set to "None" unless it is needed.
  11. Alpha Is Transparency - Shouldn't matter due to the Alpha Source
  12. Generate Mip Maps - This shouldn't matter due to the resolution of your images, but if you were to have larger images you'd want to enable this. The images would take more storage space. However, the quality would be a necessity more than likely when the large images become tiny. Mip Maps provide varying sizes of your image. They would help increase rendering performance by allowing the engine to use the appropriately sized image for the task, thereby reducing stress on the GPU and CPU. Typically, they're used for Level of Detail (LOD). Wikipedia - Mipmap
  13. Filter Mode - Are you doing transformations? Point is the most efficient I believe here.
  14. Ansio Level - Forced to 1 for sprites

  15. Max Size - Has little to no impact on performance, but will have an impact on storage size. Set this to the largest size that the image can be.

  16. Compression - Compression can help or hinder performance based on platform. "Low Quality Compression has an effect on mobile platforms, but not on desktop platforms)." Unity - Textures

Performance Tips

  1. Use smaller sprites
  2. While this article is for 3D it may have some snippets that help you out. Unity - (3D) Optimizing graphics rendering in Unity games
  3. Only draw what you need to draw when you need to draw it.
  4. Disable game components that don't need to be enabled.
  5. Keep UI components to a minimum if using the default Unity UI.
  6. Debug your game and see how many draw cycles are being done.
  7. Batch your draws where possible. Look into sprite packing.

Performance is going to be very specific to your specific project.

Upvotes: 4

Related Questions