Difference between revisions of "Atlas builder"

From PopcornFX
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
See also : [[Editor|Editor interface overview]].
 
See also : [[Editor|Editor interface overview]].
 +
 +
'''Important note (07.2019)'''
 +
 +
The '''TexturePacker''' tool (https://www.codeandweb.com/texturepacker/download) now supports exporting to PopcornFX .pkat atlas files, since its version 5.1.0.<br/>
 +
 +
For the most recent version of this documentation page, see the [https://www.popcornfx.com/docs/popcornfx-v2/rendering/texture-atlases/ v2.0 online documentation]
  
  
Line 15: Line 21:
 
= Atlas definition format, pkat files =
 
= 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:
+
The atlas definition files (.pkat files) are simple text files, usually with the same name as the atlas texture, with a .pkat extension, and contain:
  
 
* one line per sub-texture
 
* one line per sub-texture

Latest revision as of 06:43, 9 July 2019

See also : Editor interface overview.

Important note (07.2019)

The TexturePacker tool (https://www.codeandweb.com/texturepacker/download) now supports exporting to PopcornFX .pkat atlas files, since its version 5.1.0.

For the most recent version of this documentation page, see the v2.0 online documentation


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 .pkat 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