-
Notifications
You must be signed in to change notification settings - Fork 235
Home
Important
|
Under construction. Please ignore. Seems no way to make private until its ready. |
KTX (Khronos Texture) is a lightweight file format for OpenGL® and Vulkan® textures. KTX files contain all the parameters needed for texture loading. A single file can contain anything from a simple base-level 2D texture through to a cubemap array texture with mipmaps. Texture payloads can be in Basis Universal or UASTC formats, which can be transcoded to any GPU-supported format, in any of the block-compressed formats supported by OpenGL family and Vulkan APIs and extensions or in an uncompressed format. Basis Universal is a supercompressed block-compressed format. Other formats can be supercompressed with Zstandard (zstd).
The original file format specification was created by Khronos’s OpenGL ES and ARB-OpenGL ES Convergence Working Groups. The Version 2.0 file format specification was created by the 3D Formats Working Group which is also responsible for glTF™️.
The software in this repo includes libktx
, a library for reading and writing KTX files, a set of command line tools and .wasm
modules for libktx and msc_basis_transcoder
, a Basis image transcoder, together with Javascript wrappers for them. See the repo’s README.md for details.
At present there are no downloadable binaries. You will need to build the software for yourself. Xcode projects, Visual Studio solutions and CMake files for linux and web builds are available (all generated from GYP masters). See the repo’s BUILDING.md for complete instructions.
toktx
, one of the tools in this repo, can be used to create KTX and KTX 2 files using .png or Netpbm files as input. When creating the latter it can encode to Basis Universal or UASTC and can supercompress with zstd. It can create any texture structure: 1D, 2D, 3D, 1D & 2D arrays, cube maps and cube map arrays.
gltfpack
can be used to create textures encoded to Basis Universal format within a KTX2 container (-tc flag). Compression is performed using the basisu
executable and is thus only available in native builds.
Other software that can be used to create and edit KTX version 1 files and are expected to be updated for version 2 include:
-
The Adreno1 texture tool from Qualcomm, a GUI tool for compression and visualization of textures.
-
Mali Texture Compression Tool2 from ARM, a GUI tool that can create and view files with either compressed or uncompressed textures.
-
PVRTexTool3 from Imagination Technology, a GUI tool that can create and view files with either compressed or uncompressed textures.
-
Compressonator, from AMD’s GPUOpen initiative, is a set of tools to allow artists and developers to more easily create compressed texture assets or model mesh optimizations and easily visualize the quality impact of various compression and rendering technologies. There is a glTF fork of Compressonator which in theory should support KTX 2 sooner but it is not receiving much love at the moment.
1 Included in the Adreno SDK which can be downloaded from the Adreno GPU Tools and Resources page.
2 One of the PowerVR Tools. Download the PowerVR Tools Installer, run it and select the tools you wish to download and install.
3 Download the Mali Texture Compression Tool from the Mali Developer Center.
In addition to the above mentioned GUI tools, PicoPixel can be used for viewing KTX files & more and for debugging image handling in your applications.
A JS binding for libktx
is available for use with a .wasm
compilation of the library. See its documentation for details of how to use it.
There is also a JS binding for and a .wasm
module of a container-independent transcoder for images encoded in Basis Universal format so those who wish to write their own parser in JS can do so. See its documentation for details of how to use it.
There is a prototype loader in Babylon.js. See khronosTextureContainer2.ts.
See the libktx documentation for complete details of the API and examples of its use. The examples under Usage Overview on the Introduction page provide a concise summary
To report problems or suggest new functionality, please use the issues list in the GitHub repository.
Use the KTX forum of the Khronos Group Community Forums for discussion and questions.