directxtex-usage

Integrates DirectXTex for texture loading, conversion, mipmap generation, and block compression in C++ projects.

3|Updated Aug 8, 2026
One-click install
npx skills add https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer --skill directxtex-usage-jose-polanco-oxte
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: directxtex-usage
Source: https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer/tree/main/.agents/skills/graphics/sub-skills/directxtex-usage
Command: npx skills add https://github.com/Jose-Polanco-Oxte/Echos-Live-Music-Visualizer --skill directxtex-usage-jose-polanco-oxte

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Adding texture processing to a Direct3D application requires navigating DirectXTex's integration options, image containers, and processing pipeline, which is error-prone without a structured reference. ## Core Features & Use Cases - Dependency Integration: Add DirectXTex via vcpkg manifest mode, NuGet packages, or direct project references with correct CMake linkage. - Texture Processing Pipeline: Load DDS, WIC, TGA, and HDR images into ScratchImage, then resize, convert formats, generate mipmaps, and apply BC1-BC7 block compression. - Direct3D Resource Creation: Create Direct3D 11 textures and shader resource views, or Direct3D 12 committed resources with prepared upload subresources. - Use Case: A game developer needs to convert a 2048x2048 PNG diffuse texture into a mipmapped BC7-compressed DDS file for shipping; the skill provides the exact five-step pipeline code. ## Quick Start Ask the AI to add DirectXTex to your C++ project and write code that loads a PNG, generates mipmaps, compresses it to BC7, and saves it as a DDS file.

Frequently Asked Questions about directxtex-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add DirectXTex to a C++ project?

Add "directxtex" to your vcpkg.json dependencies in manifest mode, then call find_package(directxtex CONFIG REQUIRED) and link Microsoft::DirectXTex in CMake. Alternatives include the directxtex_desktop_win10 NuGet package or adding the DirectXTex .vcxproj as a project reference.

How do I convert a PNG to a compressed DDS texture?

Load the PNG with LoadFromWICFile into a ScratchImage, optionally resize and generate mipmaps with GenerateMipMaps, compress with Compress using DXGI_FORMAT_BC7_UNORM, then save with SaveToDDSFile. The texconv CLI tool performs the same pipeline in one command.

Does DirectXTex support Direct3D 12 texture creation?

Yes, DirectXTex provides CreateTexture to create a D3D12 committed resource from TexMetadata and PrepareUpload to build D3D12_SUBRESOURCE_DATA for upload via CopyTextureRegion. It also supports Direct3D 11 with CreateTexture and CreateShaderResourceView.

Can DirectXTex run on Linux or without WIC?

DirectXTex supports DDS, HDR, and TGA on Linux, but WIC codecs (PNG, JPEG, TIFF) are Windows-only. On Linux, use the auxiliary DirectXTexPNG and DirectXTexJPEG modules built on libpng and libjpeg instead.

Why does my DirectXTex function call fail?

All DirectXTex processing functions return HRESULT, so check results with FAILED() or SUCCEEDED() macros. Common causes include unsupported DXGI formats, invalid mip level counts, or missing Direct3D device pointers for GPU-accelerated BC6H/BC7 compression.