microsoft/directxtex/directxtex-usage
Claude Code and agent skill by microsoft/directxtex
- vendor
Checking that the SKILL.md file is still in the repository.
Guide for integrating and using the DirectXTex texture processing library in new projects. Use this skill when asked about adding DirectXTex to a project, loading/saving textures, format conversion, mipmap generation, block compression, or Direct3D resource creation.
Install
npx vskill@latest install microsoft/directxtex/directxtex-usageSKILL.md
The same SKILL.md was published earlier as microsoft/directxtex/directxtex-usage.
DirectXTex Usage Guide
This skill provides guidance for integrating the DirectXTex texture processing library into a C++ project.
When to Use
Invoke this skill when:
- Adding DirectXTex as a dependency to a new or existing project.
- Writing code that processes texture data (resizing, format conversion, mipmap generation, DirectX Block Compression, etc.).
- Needing to understand the typical DirectXTex processing pipeline.
Overview
DirectXTex is a texture processing library for Direct3D 11 and Direct3D 12 applications. It provides support for reading and writing DDS files, and performing various texture content processing operations including resizing, format conversion, mipmap generation, block compression, and normal map creation.
- Repository: <https://github.com/microsoft/DirectXTex>
- Documentation: <https://github.com/microsoft/DirectXTex/wiki>
- NuGet Packages:
directxtex_desktop_win10,directxtex_uwp - vcpkg Port:
directxtex
Integration Methods
vcpkg manifest-mode (Recommended)
In your vcpkg.json file, add the following:
vcpkg (classic)
Features: dx12 (DirectX 12 API support), openexr (OpenEXR support), tools (command-line tools). Triplets: x64-windows, x64-linux, arm64-windows, etc.
For DLL usage (x64-windows default triplet), define DIRECTX_TEX_IMPORT in your consuming project. For static library usage, use -static-md triplet variants.
CMakeLists.txt:
NuGet
Use directxtex_desktop_win10 for Win32 desktop applications or directxtex_uwp for UWP apps.
Project Reference
Add the appropriate .vcxproj from the DirectXTex/ folder to your solution and add a project reference. Add the DirectXTex directory to your Additional Include Directories.
Header Include
For auxiliary features, include additional headers:
DirectXTexJPEG, DirectXTexPNG are typically only used on Linux.
Key Concepts
ScratchImage
ScratchImage is the primary image container. It owns pixel memory and provides access to individual mip levels, array slices, and volume depth slices.
TexMetadata
Describes the texture dimensions, format, mip levels, array size, and type (1D, 2D, 3D, cubemap).
Blob
A memory buffer used for serialized output (e.g., saving to memory rather than files).
Error Handling
All processing functions return HRESULT. Check with FAILED() / SUCCEEDED() macros.
Common Workflows
Loading Textures
Saving Textures
Format Conversion
Resizing
Mipmap Generation
Block Compression
Decompression
Normal Map Generation
Premultiplied Alpha
Creating Direct3D 11 Resources
Creating Direct3D 12 Resources
Typical Texture Pipeline
A common offline texture processing pipeline:
Format Utilities
DirectXTex provides utility functions for querying DXGI format properties:
Platform Support
| Platform | DDS | HDR | TGA | WIC | Direct3D 11 | Direct3D 12 | |
|---|---|---|---|---|---|---|---|
| Windows desktop | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| UWP | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| Xbox (GDK) | ✓ | ✓ | ✓ | — | ✓ | ✓ | |
| Linux | ✓ | ✓ | ✓ | — | — | — |
Command-Line Tools
DirectXTex includes three CLI tools for texture processing:
- texconv — Convert images to DDS with compression, mipmaps, and resizing
- texassemble — Create cubemaps, texture arrays, and volume maps from individual images
- texdiag — Inspect and validate DDS files
Example texconv usage:
Further Reading
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 17 Aug 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/directxtex-usage/SKILL.md
Popularity
- Repository stars
- 2,138
- Repository forks
- 492
- 7-day trend score
- 38
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/directxtex/directxtex-usage)