Splashing around on the surface
So what does this here XNA Content Pipeline thingummyjig actually DO, anyway?
I'm going to start off with an example of how you could use it, working entirely with the default XNA importers and processors.
Imagine I'm making a game called "Super Dromedary Racer X". Let's pretend I have the following game assets:
What next?
-
Open up Visual Studio C# Express.
-
Select the "New XNA Game" project template.
-
Add my asset files to the project, just like I would for C# code files.
-
Press F6 to build the project, including my asset files.
Ok, I admit it's not quite that easy! I have to write some code at this point...
ContentManager loader = new ContentManager();
Model myFunkyDude = loader.Load<Model>("HeroCharacter");
Model bigEmptyDesert = loader.Load<Model>("BigEmptyDesert");
Texture2D background = loader.Load<Texture2D>("AmazingSunset");
Effect heatHaze = loader.Load<Effect>("HeatHaze");
And there we have it.
This may seem pretty straightforward, but there is actually quite a lot going on behind the scenes:
-
The Content Pipeline tracks references from one asset to another. For instance if my HeroCharacter.x or BigEmptyDesert.fbx files used any textures, it would notice this and automatically go build those textures as well. Even better, if both meshes happened to use the same texture, it is smart enough to only bother building that texture once.
But wait, there is more! Everything in the content pipeline is extensible, and we want you to extend it. Stay tuned for details…