Atlas builder

From PopcornFX
Jump to: navigation, search

See also : Editor interface overview.


Overview

The atlas builder is the tool used to generate Popcorn's atlas files.
It currently can't be launched directly from the main popcorn editor.

You can find it alongside "PK-Editor.exe", for example in: "C:\Program Files (x86)\Persistant Studios\PopcornFx\Binaries_Release\AtlasBuilder.exe" Popcorn-Fx Atlas builder icon


Popcorn-Fx Atlas builder


Atlas definition format, pkat files

The atlas definition files (.pkat files) are simple text files, usually with the same name as the atlas texture, with a .txt extension, and contain:

  • one line per sub-texture
  • 4 values per line, separated by commas
  • the decimal point is a dot, not a comma
  • the values are normalized texture coordinates, between 0.0 and 1.0
  • the values are in the following order: left corner, top corner, right corner, bottom corner

Atlas format

for example, for a 2*2 texture atlas containing 4 equal-sized squared textures, the atlas definition file would look like:

Atlas builder : 2x2 atlas example
0, 0, 0.5, 0.5
0.5, 0, 1, 0.5
0, 0.5, 0.5, 1
0.5, 0.5, 1, 1

Of course, the sub-rectangles can be anything, the whole texture doesn't have to be covered entirely either:

Atlas builder : 3x1 atlas example
0,     0, 0.333, 0.5
0.333, 0, 0.667, 0.5
0.667, 0, 1,     0.5

Right-click Save As:

Atlas_2x2.pkat

Atlas_3x3.pkat

Atlas_4x4.pkat

Atlas_5x5.pkat

Atlas_6x6.pkat

Atlas_7x7.pkat

Atlas_8x8.pkat

Atlas_9x9.pkat

Atlas_10x10.pkat

...

Atlas_32x32.pkat