Author Topic: Best Practices for Atlas Switching  (Read 2705 times)

Phong

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 4
    • View Profile
Best Practices for Atlas Switching
« on: June 25, 2012, 11:53:02 AM »
I watched the video on atlas switching and searched the forums but I still have a few questions. Here is my setup

AtlasRef
AtlasHD
AtlasSD
FontRef
FontHD
FontSD

Question 1 Which atlas should the FontHD and the FontSD reference? Is it OK for them to reference the AtlasRef?

Question 2 What is the best approach for creating the SD atlas and fonts? I tried:
  • Creating the HD atlas first
  • Duplicating the HD atlas prefab, material and png to create SD atlas
  • Shrinking the copied png to half size and updating the references in the SD material and prefab
  • Also duplicated the HD font and pointed the the copy to the SD atlas but it didn't work so I created an SD font from scratch and added it the the SD atlas
Is there an easier or better approach for creating the SD atlas?
Is it dangerous to create atlases by duplicating an existing atlas instead of using the atlas maker?
Is there an easier way to create smaller fonts or fix a font's reference in the atlas?

What is the best way of doing this?

O.K. Way more than two questions. Advice would be very much appreciated thanks!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Best Practices for Atlas Switching
« Reply #1 on: June 25, 2012, 12:54:06 PM »
1: No. HD and SD atlases should not reference anything. They should be actual atlases. AtlasRef should point to one of them. When designing, have it point to whatever is your "default" atlas that you'll be creating your UI in. When deploying, set it to reference nothing, and in Awake() of your loading script, check the resolution and Resources.Load the appropriate atlas -- HD or SD -- then set the AtlasRef to point to that atlas.

2: If you switch the atlas to use texture coordinates instead of pixels, you can shrink the atlas texture safely without having to re-do all the sprite coordinates. Generally your artist will provide you with HD and SD versions of each texture though. Shrinking it manually will degrade quality.

Duplicating an atlas prefab is just fine.