Customizing how models build their textures

When the content pipeline builds a model, by default it will use the ModelTextureProcessor to convert all the textures used on that model.   There are many reasons why you might want to override this behavior: You might want to change the output texture format You might want missing texture files to be silently ignored,…

1

Flattening unwanted bones

Sometimes it is useful to have multiple bones and meshes inside a single model (see my previous post), but other times this just causes needless complexity. All that messing around with Model.CopyAbsoluteBoneTransformsTo and setting the effect World matrix is important if you want to do things like making your car wheels spin and the doors…

3

Models, meshes, parts, and bones

If you look inside the XNA framework Model class, you will see that it contains a Meshes property holding a collection of ModelMesh instances. If you look inside the ModelMesh class, you will see that each one contains a MeshParts property holding a collection of ModelMeshPart instances. Not to mention the Model.Bones property, which holds…

5

SpriteBatch and renderstates

2010 update: if you are using a version of XNA Game Studio >= 4.0, see here instead. If you are mixing 3D rendering with 2D objects using SpriteBatch, you may notice that your 3D graphics no longer draw correctly after you have rendered sprites. This is because the SpriteBatch changes several device renderstates to values…

27

Debugging the content pipeline

Content pipeline importers and processors run inside Visual Studio as part of building your game. This means you can’t just debug into them like you would for normal game code. Fortunately, the CLR provides a handy way of hooking a debugger up to any managed program you like. You just need to modify your processor…

17

Build it ahead of time

One of the biggest differences between the XNA content pipeline and the way many people are used to loading their game assets is that with the content pipeline, games no longer read directly from standard asset formats like .X, .BMP, and .FX. Instead, we process those files into a specialized binary format at the same…

11

Add the mesh, not the textures

Here’s a common mistake for people new to the Content Pipeline… If you have a mesh file that references a bunch of texture files, and you want to use this with XNA, you only need to add the mesh to your C# Express project. When we build the mesh we will notice what textures it…

4

XNA Beta 2

Finally! Beta 2 is available for download from http://msdn.microsoft.com/directx/XNA/ This includes the Content Pipeline, so now you have that in your hands, I’ll be posting and answering questions about how the whole thing works. Let me know if there are any particular topics you’d like me to write about. In the meantime, I’m going back…

1