Author Topic: Texture atlas with lots of black space  (Read 2547 times)

itszander

  • Guest
Texture atlas with lots of black space
« on: September 10, 2012, 04:57:35 PM »
HI all, I've been working through the process and have been creating a texture atlas for SD and HD fonts.  I'm noticing that when i create texture atlas i see lots of black space and the atlas is really big (2048x2048) but is mostly unused space. Am I doing something wrong here?

i've attached an image so you can see the problem

PhilipC

  • Guest
Re: Texture atlas with lots of black space
« Reply #1 on: September 10, 2012, 06:12:25 PM »
Question how big is the texture of the largest font that you have? It almost looks like its > 1024 (or half of the 2048 texture) this would cause the atlas to bloat to a 2048.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Texture atlas with lots of black space
« Reply #2 on: September 10, 2012, 07:17:14 PM »
The trick is to keep it at 1 unit below the power-of-two dimensions. So for example if you were exporting the font as 1024x1024, do it as 1023x1023 instead. Although looking at your font, I'd go with a non-power-of-two ratio that would create square textures on export instead. Try something like 600x600.

itszander

  • Guest
Re: Texture atlas with lots of black space
« Reply #3 on: September 11, 2012, 08:49:19 AM »
Thanks for the feedback! It's very helpful...