Sign in to follow this  
hplus0603

Microsoft X file support: time to vent!

Recommended Posts

hplus0603    11356
On one hand, XNA Game Studio Express supports two file formats: .X file, and FBX file. The FBX file format is closed, binary, and proprietary to Autodesk (not Microsoft). On the other hand, the November version of the DirectX SDK silently dropped support for writing .X files. The header files for the API and data structures just aren't there anymore. Is it just me, or is the DirectX group getting less and less in touch with reality as time moves on?

Share this post


Link to post
Share on other sites
Stereo    256
Are you referring to the November 2007 release? Support for writing .X files is still there, i.e.

HRESULT WINAPI
D3DXSaveMeshToXA(
LPCSTR pFilename,
LPD3DXMESH pMesh,
CONST DWORD* pAdjacency,
CONST D3DXMATERIAL* pMaterials,
CONST D3DXEFFECTINSTANCE* pEffectInstances,
DWORD NumMaterials,
DWORD Format
);

taken from d3dx9mesh.h.

I've been using D3DX for .X meshes and calculating ambient occlusion data for them recently, so I can confirm that these functions are still there and working.

Share this post


Link to post
Share on other sites
jollyjeffers    1570
I've had the distinct feeling for years that the .X file format is an unloved child [oh]

The fact that its disappearing has always been a 'when' rather than an 'if' in my mind, but it is a very long and drawn out death! We've seen the DX team hack entire components out of the SDK in short timeframes (MDX) so quite why they are hanging on to .X and slowly phasing it out I don't know...

At one of the MVP Global Summits one of the developers (I forget who exactly) stated that there were actually very few customers using the .X format. Most game studios had their own format or had adopted other standard formats (to fit their content pipeline or to suit X-Platform work) and consequently there was little to no pressure on Microsoft to push the format.

Assuming that is still the case then it does seem reasonable from a business perspective - there is only so much time and resource available after all. That aside, it would be nice to know where we stand on this matter - if it is dead or dying then fine, lets move on. It's the limbo that causes headaches.


Cheers,
Jack

Share this post


Link to post
Share on other sites
legalize    116
Quote:
Original post by hplus0603
Quote:
Support for writing .X files is still there


I'm referring to the template and guid declarations you need to write meshes on your own at a lower level. Such as I do in the kW X-port exporter, for example.


It's a bug in the SDK. They removed these thinking that people didn't need them anymore, but you do, even if you use the ID3DXFile* interfaces for manipulating .x files. The only thing the missing header files provide are the template and GUID definitions for the "standard" templates. There are no missing API declarations and there are no missing data structures. The template definitions are in the form of a big string and the GUID definitions are in the form of symbolicly named GUID references or GUID definitions depending on what preprocessor symbols are defined when you include the file with the GUID symbols.

The workaround is simple. Get an older release of the SDK that includes the missing header files and add them to your include file search path.

The .X file format came originally from the MS acquisition of RenderMorphics (sp?). Its not a bad concept, but it is only supported by the SDK as an interchange format. It turns out that very few, if any, commercial applications use the .X format directly as their scene storage. Its not really the best format for that anyway because it needs lots of massaging to go from the .x format organization to the vertex buffer and index buffer organization.

That's why its still used by XNA GSE as well -- its a useful format for interchange; when the content pipeline portion of your build process runs, it converts the .x file data into an opaque data structure used by the content pipeline -- just like any other format supported by the content pipeline. In GSE, the content pipeline is just a mechanism for getting your scene data compiled into the internal format used by the framework. Its misleading to say:

Quote:
XNA Game Studio Express supports two file formats: .X file, and FBX file.


GSE is extensible and open-ended in terms of the content support provided. You can add your own custom file format to the XNA content pipeline and it will work with that too. This, of course, requires writing the code that interacts with your custom file format and the content pipeline. This is exactly how SoftImage XSI integrates its model format directly into XNA GSE. You can do the same thing; SoftImage didn't use any special Microsoft knowledge or access to integrate their format into the pipeline.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this