Unity3D 2D动画插件EasyMotion2D (之七)Atlas Editor

What is Atlas Editor

Atlas Editor is a tool use for pack sprites to a big atlas texture in EasyMotion2D.

Why use atlas

  • Drawcall batch
    • In Unity3D if objects have the same material and material's parameters member are the same, they will can be rendering in one drawcall. It's a very important optimization for mobile device.
  • RenderModeSetting
    • In EasyMotion2D it use RenderModeSetting asset to decide how the sprite will rendering. EasyMotion2D will group sprites by RenderModeSetting and texture and sprite's depth in scene.
    • If sprites in a depth range and they use the same RenderModeSetting and same texture, then these sprite can rendering in one drawcall.
    • For example:
      • Here is some sprites with same RenderModeSetting and some texture, you can see it only has 1 drawcall.
      • Here is some sprites with same RenderModeSetting but different texture, so you can see the drawcall batch is broken, it was 3 drawcall.
      • After pack the different textures into a atlas texture, you can see the drawcall become to 1 again.
  • So that is why we need use atlas editor, because we need pack each small texture into a big texture to make sprites rendering batch friendlly.

How to use

  • Select the menu item EasyMotion2D > Sprite Atlas Editor > Open Window to open the Sprite Atlas Editor.

Four step to create a atlas

  1. Open or Create a atlas asset in project.
    • Click the “Create Atlas” button in left-top of Atlas Editor window will create a Atlas Asset file in Project Window. The Asset file's path is same as current selection in Project Window. If current has no selection in project window, path will be asset folder's path.
    • Click the object field you can selected a exist atlas in project, and open it to edit.
  1. Drag and drop sprites from   Sprite Asset Viewer  to atlas editor you want pack.
  1. Layout sprites in texture automatically or muanually.
    • You can click “Layout” button to layout sprites automatically.
    • You can also drag sprite to layout manually.
  1. Build the atlas texture.
    • Click “Build” button can be pack all sprite into a atlas texture.

The Layout option panel

  • Texture
    • If atlas already have a atlas texture, it will display in this field.
  • Width & Height
    • The atlas texture's width and height.
  • Texture Size
    • The atlas texture size you will want pack into.
  • Enable Resize Toggle
    • If check this, layout operation will auto adjust texture size to pack all sprites.
    • If not, will use the Texture Size as atlas texture size to pack all sprite into, if can not pack all sprite into the texture with Texture Size, will ouccr an error.
  • Set Width/Height same Toggle
    • If check this, will make texture's width and height are same, even pack all sprite do not need the size of texture.
  • Sort By
    • Sorting the sprites by what.
    • Layout will sorting all the sprites you want pack, and find space to layout they one by one.
  • Sort Order
    • Sorting sprites order.
  • Padding
    • The padding of sprites between each other.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值