Diving deeper

Originally posted to Shawn Hargreaves Blog on MSDN, Saturday, August 26, 2006

At first glance the XNA Content Pipeline may seem to cover similar ground to the old D3DX utility library. For instance both provide a simple way to access graphics from .X files:

// D3DX

Mesh ungulate = Mesh.FromFile("dromedary.x", 0, device);

// XNA

Model ungulate = loader.Load<Model>("dromedary");

But in fact the Content Pipeline architecture is very different to D3DX. For one thing we include a Visual Studio user interface and incremental build capabilities, where D3DX just provided helper functions and left it up to you to figure out where and how to call them. There are also some fundamental philosophical differences between the two technologies.

 

First up: extensibility.

 

D3DX is not extensible. It provides a good starting point for a lot of people, but often isn't suitable for more advanced programmers and engine developers. Games using D3DX run into a brick wall if they ever need to do something that D3DX does not support. Maybe they've written their own level editor, so they want to load from a file format other than .X. Or perhaps their engine wants to do something clever at runtime, beyond what the basic D3DX Mesh class provides.

 

When I've written my own game engines in the past, I often wanted to use bits of functionality from D3DX. Because I had my own level editor, file format, and mesh class, I had to write lots of laborious code to convert my data to and from .X files that D3DX could process. Not fun!

 

With the XNA Content Pipeline we have tried to make the easy things easy, while still leaving room for advanced users to customize and extend how everything works. For instance:

There are a couple of areas that are less extensible. For instance our incremental build system "just works" as long as you use our importer and processor object model. This seemed like something we could get right for a lot of people without requiring anyone to extend it, so we just went ahead and took care of it for you.

Blog index   -   Back to my homepage