1

Closed

meshconvert utility

description

The legacy DirectX SDK included a utility that converts objects exported as .X (text or binary) form to .sdkmesh (the DirectX SDK Sample Format).

A useful modern replacement that supports Wavefront OBJ and a subset of legacy .X files could be a useful tool for inclusion in the DirectXMesh library.
Closed Oct 22, 2014 at 10:23 PM by walbourn

comments

walbourn wrote Jun 27, 2014 at 8:04 PM

The utility could support outputting .VBO, .SDKMESH, and perhaps even .CMO

walbourn wrote Jun 27, 2014 at 8:06 PM

The primary challenge with consuming .x files is that all the XFile and D3DX9 functionally is legacy. It is fairly easy to write a parser for the uncompressed binary form, and a doable amount of work to parse the text form. Supporting the 'compressed' binary form is out-of-scope.

walbourn wrote Oct 22, 2014 at 10:23 PM

Resolved with changeset 38627: MeshConvert: command-line utility and sample for DirectXMesh

walbourn wrote Oct 22, 2014 at 10:24 PM

The initial version can import from VBO and Wavefront OBJ, and can produce .VBO, .CMO, and .SDKMESH files.

walbourn wrote Oct 22, 2014 at 11:17 PM

Associated with changeset 38628: meshconvert: fixes for /? output

Aranda wrote Feb 19, 2015 at 5:40 AM

Not sure why this is Closed given the description is about X files and yet converting X files is still not supported by MeshConvert.

We would like to upgrade to DirectX11 (or 12) and have an issue that we need to support loading thousands of different X files on customer machines. Is it feasible to load (at runtime) D3DX9 and copy the mesh data into a format acceptable by D3D11? (ie keep distributing D3DX9). I guess you will recommend we convert all data to SDKMESH or similar, but I'm just wondering if it's even feasible.

walbourn wrote Feb 19, 2015 at 6:43 PM

This work item covered creating the meshconvert utility in the first place. I have a work item 1263 for adding legacy X file support.

The problem is that all XFile APIs are in the deprecated D3DX9 DLL, and there's no project to get them available in any other form. My plan for adding X file support to meshconvert would be to optionally invoke D3DX9 if present on the system, but of course my intention would be for the tool to be used only on development machines, not end-user machines.

You can continue to use legacy the D3DX9 DLL but it requires a number of things to keep in mind: Installing the legacy DirectX SDK itself has known isssues. See KB 2728613 Using the legacy DirectX SDK with the Windows 8.x SDK included in VS 2012/2013/2015 requires different path settings and some #include trickery. See MSDN* Deploying D3DX9 requires using the legacy DirectSetup package. Be sure to read Not So DirectSetup, MSDN, and DXSETUP Update.* No elements of the legacy DirectX SDK can be used in Windows Store apps, Windows phone apps, or Xbox One apps.

You can of course also write your own X-file parser based on the format description, which actually might be a better idea for you long-term. Still, you can load content with D3DX9's mesh class and then marshal the data into D3D11 VBs/IBs in a Win32 desktop application.

Aranda wrote Feb 20, 2015 at 5:56 AM

Thanks for the detailed response, it's much appreciated.