mesh-converter
Skill860 starsChanged 4 months agoMITView on GitHub
Guide for using the meshconvert command-line tool to convert Wavefront OBJ files to DirectX runtime formats (CMO, SDKMESH, VBO).
In this repository3 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- Release ProcessSkill
- directxmesh-usageSkill
The file
Files
Mesh Converter Skill
This skill provides guidance for using the meshconvert command-line tool to convert Wavefront OBJ geometry files into runtime formats consumed by DirectX Tool Kit.
When to Use
Invoke this skill when:
- Converting Wavefront OBJ files to SDKMESH, CMO, or VBO format.
- Preparing mesh geometry for use with DirectX Tool Kit (DirectXTK).
- Generating normals, tangents, or performing vertex-cache optimization on mesh data.
- Understanding the available output formats and their requirements.
Overview
The meshconvert tool imports geometry from Wavefront Object (OBJ) or VBO files and prepares it for runtime use. It can generate normals and tangent frames, perform vertex-cache optimization, and write to formats suited for DirectX applications.
- Repository: https://github.com/microsoft/DirectXMesh
- Documentation: https://github.com/microsoft/DirectXMesh/wiki/Meshconvert
- Installation:
winget install Microsoft.DirectX.Mesh
Installation
winget (Recommended)
winget install Microsoft.DirectX.Meshvcpkg
vcpkg install directxmesh[tools]Basic Syntax
meshconvert [options] [--file-list <filename>] <file-name(s)>The tool uses Windows-style - or / for options, and also supports GNU long options with --.
Output Formats
| Format | Switch | Description | Requirements |
| SDKMESH | -ft sdkmesh | Default output format for DirectX Tool Kit Model class | None |
| SDKMESH (PBR) | -ft sdkmesh2 | SDKMESH with PBR materials | None |
| CMO | -ft cmo | Visual Studio CMO format for DirectX Tool Kit Model class | Normals, tangents, and texture coordinates |
| VBO | -ft vbo | Simple vertex buffer object format for DirectX Tool Kit | Normals and texture coordinates |
| OBJ | -ft obj | Re-export as Wavefront OBJ | None |
Common Workflows
Basic Conversion to SDKMESH (Default)
meshconvert model.objProduces model.sdkmesh with no additional processing.
Convert with Normals and Optimization
meshconvert model.obj -n -opGenerates normals (weight by angle) and performs vertex-cache optimization using the Hoppe algorithm.
Convert to CMO Format
CMO format requires normals, tangents, and texture coordinates:
meshconvert model.obj -ft cmo -n -tbConvert to VBO Format
VBO format requires normals and texture coordinates:
meshconvert model.obj -ft vbo -nConvert with Full Processing Pipeline
meshconvert model.obj -n -tb -op -yGenerates normals, tangent frames (tangents and bi-tangents), optimizes the vertex cache, and overwrites any existing output file.
Convert for Direct3D Coordinate System
OBJ files from tools using OpenGL conventions may need coordinate adjustments:
meshconvert model.obj -n -op --flip-v --flip-zFlips the V texture coordinate and negates Z for right-hand to left-hand conversion.
Batch Conversion
meshconvert -r *.obj -n -op -yRecursively processes all OBJ files in the current directory and subdirectories.
Or use a file list:
meshconvert --file-list models.txt -n -op -yWhere models.txt contains one filename per line (lines starting with # are comments).
Option Reference
See reference/options.md for the complete command-line options reference.
Format-Specific Notes
SDKMESH
- Default output format.
- Supports 16-bit and 32-bit index buffers (auto-selects 16-bit when possible).
- Supports configurable vertex formats for normals, UVs, and colors.
- Used by DirectX Tool Kit's
Modelclass viaModel::CreateFromSDKMESH.
CMO
- Visual Studio's mesh format.
- Requires normals, tangents, and texture coordinates — use
-n -tbswitches. - Fixed vertex format (no
-fn,-fuv,-fc, or-ib32options). - Used by DirectX Tool Kit's
Modelclass viaModel::CreateFromCMO.
VBO
- Simple binary format with position, normal, and texture coordinates.
- Requires normals and texture coordinates — use
-nswitch. - Fixed vertex format (no
-fn,-fuv,-fc, or-ib32options). - Limited to 65535 vertices (16-bit indices only).
- Used by DirectX Tool Kit's
Modelclass viaModel::CreateFromVBO.
Key References
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

