Integrating Your XNA Engine With XSI ModTool
IntroductionFor many a hobbyist developer, the XNA Framework has been a gift from above. The combination of a robust game-development framework with Microsoft’s venerable Direct3D graphics back-end can be a winning combination for student programmers making their first game, or bedroom coders who don’t have time to waste on creating tedious boilerplate code. With all of the framework classes and samples dedicated to showing you how easy it is to get a very simple game up and running in 30 minutes, it’s pretty easy to forget that with XNA it’s possible to craft complex, professional-level games by making the most of features like the Content Pipeline (even without a professional budget!). In that regard, this article is going to walk you through an implementation a 3D content authoring system that can allow you to seamlessly integrate XSI ModTool with your gaming engine. PrerequisitesThis article assumes at least basic familiarity with: C#, the XNA Framework graphics classes, the XNA Framework Content Pipeline, and HLSL. To compile the sample code, you will need to have XNA Game Studio 2.0 installed as well as Visual Studio 2005 (Visual C# Express 2005 can be used). The sample project also references the XSI Crosswalk Importer assembly, which is installed to the ModTool installation directory. Make sure this reference is properly set before compiling (the section titled “Publishing The Model And Importing It Into The Content Pipeline” details this process). Why Bother With Content Authoring Integration?If you scan through the rest of the article and see the amount of work involved, you may be wondering “why should I even bother with this?” Or you may be thinking “this seems like overkill for my small project.” After all the XNA Framework is rather flexible, and it’s perfectly feasible to find other ways to get content into your game that doesn’t just use BasicEffect. For example, the ShipGame starter pack uses a custom NormalMapping effect for all meshes. And it does it in a very simple way: by simply ignoring the effect assigned to the mesh being rendered and using the NormalMapping effect instead. This of course works, but has limitations: What if you don’t want to use just one effect for everything? What about effect parameters that aren’t texture-based? Should the artists be messing around with the code to get what they want? Content authoring integration does not have these disadvantages. Instead it has the following advantages:
Why XSI ModTool?When it comes to 3D modeling, 3D Studio Max and Maya are usually the first names to come up. They’re fantastic, full-featured applications and it’s much more likely that a 3D artist is going to be familiar with one of them. However they pose a huge problem for any hobbyist developer: they cost money — a lot of money. ModTool, on the other hand, is completely free for non-commercial use. While there are other free tools available (such as Blender), ModTool is conveniently designed to be integrated with XNA Game Studio project. Plus, it supports the ability to use real-time previewing of Direct3D effects with models, which is crucial for our content integration system.
|
|