UserGuide PDF
UserGuide PDF
ATF Tools
User Guide
Contents
1. Introduction 2
2. png2atf 3
3. pvr2atf 5
4. dds2atf 7
5. ATFViewer 9
6. atfinfo 9
1/10
Adobe Systems confidential and proprietary information
1. Introduction
This document is a reference for the tools which are made available to create and manage ATF files
(Adobe Texture Files). ATF files are the recommended file type for fixed texture assets when used in con-
junction with the Flash Player Molehill APIs.
1 http://www.itu.int/rec/T-REC-T.832
2 http://msdn.microsoft .com/en-us/library/bb147243%28v=VS.85%29.aspx
3 http://msdn.microsoft .com/en-us/library/bb147243%28v=VS.85%29.aspx
4 http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt
5 http://www.imgtec.com/powervr/insider/powervr-pvrtexlib.asp
2/10
Adobe Systems confidential and proprietary information
2. png2atf
png2atf is a command line utility which converts PNG files to ATF files. The resulting ATF files can then
be directly used with the uploadCompressedTextureFromByteArray() ActionScript 3 API. png2atf takes
any valid PNG file and by default converts it to either a RGB or RGBA ATF file, depending on if the PNG file
has transparency. It can optionally also create a block based compression texture if the source PNG has no
transparency.
2.1 Invocation
To convert a PNG file to a RGB or RGBA ATF file run the command as such:
To create a block based compression texture file run the command as such:
3: Top
(positive y)
2: Bottom
(negative y)
3/10
Adobe Systems confidential and proprietary information
-s Silences any output the tool might have during compression. This can be useful for
batch processing.
-4 Instructs the JPEG-XR encoder to use a 4:4:4 color space internally. This is the default
for block based compression. In some cases it is desirable to use this color space for
RGB/RGBA textures in case you see color bleeding artifacts around red or blue shapes
or for normal maps.
-2 Instructs the JPEG-XR encoder to use a 4:2:2 color space internally. It is not recom-
mended to use this color space for block based compression as this can cause severe
artifacts.
-0 Instructs the JPEG-XR encoder to use a 4:2:0 color space internally. This is the default
for RGB/RGBA textures. It is not recommended to use this color space for block based
compression as this can cause severe artifacts; though it might be worth experiment-
ing with this option if for instance the image data is monochromatic.
-q <0-180> Selects the quantization level, i.e. how much the image data should be compressed. A
value of 0 means loss less compression which is the default for block based compres-
sion textures. It is not recommended to use lossy compression for block based com-
pression; though it is worth to experiment with this value from a case to case basis.
The default value for RGB and RGBA textures is 30. Higher values will create more ar-
tifacts, smaller values will reduce artifacts. Note that you should not confuse this with
the standard JPEG compression factor. Its similar in concept but applies in a different
non-linear range.
-f <0-15> Selects how many flex bits should be trimmed during JPEG-XR compression. This op-
tion in not related to the quantization level but selects how much noise should be re-
tained across the image. Like the quantization level higher values create more artifact.
The default value is always 0.
-n <start,end> Embed a specific range of textures for texture streaming. Range starts from 0 for the
main texture and 1 and above for mip levels. The size information of the main level is
retained when the .atf file is created even when a sub set of ranges are selected.
Typical example for texture streaming, creating 3 levels for a 512x512 texture:
To stream these 3 levels, create a 512x512 texture in ActionScript and then upload
olow.atf, omed.atf and ohigh.atf in sequence.
-x Read mip map images from input files instead of auto-creating them. Input files
need to be named <filename><ll>.png ,where ll=00-12. For cubemaps, the format is
<filename><ll><n>.png.
-e Embeds empty (black) mip maps.
-r Compress block compressed textures using JPEG-XR+LZMA to reduce file size.
4/10
Adobe Systems confidential and proprietary information
3. pvr2atf
pvr2atf is a command line utility which converts PVR texture files to ATF files which can then be used
with the uploadCompressedTextureFromByteArray() ActionScript 3 API. The tool works similarly to png2atf
except that you have to provide input files in the PVR texture file format. For block based compression you
can either provide a single compressed file or a set of 3 to embed all three supported formats to target mul-
tiple GPU architectures.
3.1 Invocation
To convert a PVR file to a RGB or RGBA ATF file run the command as such:
To create a block based compression texture file run the command as such, where each input PVR file
represents a block compressed file format:
A single block compressed file can also be provided, in which case the other formats will be left empty
(and potentially creating runtime exceptions when uploadCompressedTextureFromByteArray() is used):
6 http://www.imgtec.com/powervr/insider/powervr-pvrtextool.asp
5/10
Adobe Systems confidential and proprietary information
To stream these 3 levels, create a 512x512 texture in ActionScript and then upload
olow.atf, omed.atf and ohigh.atf in sequence. Texture streaming is only supported in
Flash Player 10.4 or newer.
6/10
Adobe Systems confidential and proprietary information
4. dds2atf
dds2atf is a command line utility which converts DDS texture files to ATF files which can then be used
with the uploadCompressedTextureFromByteArray() ActionScript 3 API. The tool works similarly to png2atf
except that you have to provide input files in the DDS texture file format. For block based compression you
can either provide a single compressed file or a set of 3 to embed all three supported formats to target mul-
tiple GPU architectures.
4.1 Invocation
To convert a DDS file to an ATF file run the command as such:
7/10
Adobe Systems confidential and proprietary information
-f <0-15> Selects how many flex bits should be trimmed during JPEG-XR compression. This op-
tion in not related to the quantization level but selects how much noise should be re-
tained across the image. Like the quantization level higher values create more artifact.
The default value is always 0.
-n <start,end> Embed a specific range of textures for texture streaming. Range starts from 0 for the
main texture and 1 and above for mip levels. The size information of the main level is
retained when the .atf file is created even when a sub set of ranges are selected.
Typical example for texture streaming, creating 3 levels for a 512x512 texture:
dds2atf n 1,1 i i.dds o ohigh.atf
dds2atf n 2,2 i i.dds o omed.atf
dds2atf n 3,9 i i.dds o olow.atf
To stream these 3 levels, create a 512x512 texture in ActionScript and then upload
olow.atf, omed.atf and ohigh.atf in sequence.Texture streaming is only supported in
Flash Player 10.4 or newer.
8/10
Adobe Systems confidential and proprietary information
5. ATFViewer
ATFViewer is a GUI tool which previews and inspects ATF files. The primary purpose is to audit DXT1,
ETC1 and PVRTC compression artifacts. You can open and view ATF files by either using the Open... menu
item or by dragging a file from Explorer into the window.
The Snippet preview area shows you an example of how to load a particular ATF file in ActionsScript 3.
code.
6. atfinfo
atfinfo is command line utility which displays internal information about ATF files. It prints size, mip
map count, texture type, texture format, the actual number of mipmaps, whether there are any empty mip-
maps, and whether it is a cube map. It also shows which ActionScript 3 classes and format correspond to a
particular format.
6.1 Invocation
C:\> atfinfo -i test.atf
File Name : test.atf
ATF File Type : Compressed (DXT1+ETC1+PVRTC4bpp)
ATF Version : 2
Size : 1024x1024
Cube Map : no
Empty Mipmaps : no
Actual Mipmaps : 10
9/10
Adobe Systems confidential and proprietary information
Embedded Levels : .XXXXXXXXXX (512x512,256x256,128x128,64x64,32x32,16x16,8x8,
4x4,2x2,1x1)
AS3 Texture Class : Texture (flash.display3D.Texture)
AS3 Texture Format : Context3DTextureFormat.COMPRESSED (flash.display3D.Context3D
TextureFormat)
10/10