https://github.com/khronosgroup/ktx-specification
KTX file format source
https://github.com/khronosgroup/ktx-specification
ktx ktx2 specification-source texture-file-format
Last synced: 13 days ago
JSON representation
KTX file format source
- Host: GitHub
- URL: https://github.com/khronosgroup/ktx-specification
- Owner: KhronosGroup
- License: other
- Created: 2018-05-25T19:54:27.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2025-02-25T12:47:38.000Z (3 months ago)
- Last Synced: 2025-05-07T10:18:09.107Z (13 days ago)
- Topics: ktx, ktx2, specification-source, texture-file-format
- Language: CSS
- Homepage:
- Size: 3.05 MB
- Stars: 75
- Watchers: 13
- Forks: 12
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: license.adoc
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
## Home of the KTX File Format Specification
[](https://travis-ci.org/KhronosGroup/KTX-Specification)
KTX is a file format that can be used for storing GPU-ready texture data (with cubemaps, mip levels, etc).
Like DDS but with more features and more formal specification. It supports Basis Universal transcodable formats and supercompression which can yield JPEG-sized universal textures. glTF will use Basis Universal textures in KTX v2 containers.Click these links to see the latest published versions of the
[KTX File Format Specification](https://registry.khronos.org/KTX/specs/2.0/ktxspec.v2.html)
or the [KTX Fragment URI Specification](https://registry.khronos.org/KTX/specs/2.0/ktx-frag.html)
from the Khronos KTX Registry, visit the project's
[GitHub Pages](https://github.khronos.org/KTX-Specification/) to see formatted
versions of the latest commits to `main` (both options look much better than
the ersatz views provided by GitHub) or run```bash
make
```in a Unix-like environment with [AsciiDoctor](https://asciidoctor.org/docs/install-toolchain/)
installed to generate the publishable specs. They are the files `out/specs/ktxspec.v2.html` and `out/specs/ktx-frag.html`.
Everything needed is inlined.The canonical KTX spec. text is in the file `ktxspec.adoc`. The canonical fragment URI spec. text is in the file `ktx-frag.html`.
If you have questions or comments that don't merit creating an issue such as "why did you do
so-and-so?" use GitHub [Discussions](https://github.com/KhronosGroup/KTX-Specification/discussions).### GPU texture format mappings
To ensure correct mappings from Vulkan's `VkFormat` to other GPU APIs, this repo additionally contains:
- [JSON database](formats.json) ([schema](formats.schema.json)) with mappings to OpenGL, Direct3D, and Metal enums.
- [Switch-case generator](generate_format_switches.rb) that produces 5 files with simple C-like case-return statements.
> **Usage:** `./generate_format_switches.rb []`
- [Compile test of the case statements](switch_test/vk2gl.c) that serves as an example of use. To try the compile test do```bash
cd switch_test
make
```
or
```bash
make testswitches
```