Jul 13

By Don Burnett

In our last XNA tutorial we set up a simple “Hello World” Application that took us through creating an XNA game studio project for the new XNA Game Studio 4.0.. Today we are going to look at another free tool called Autodesk’s SoftImage ModTool which is a free download.

image

You should download and install this, it will prompt you for updates and if you want to install them automatically, you should say yes, including the XNA Game Studio integration Update..

After installing these updates you will notice a new menu item.. “ XNA Game Studio

menuitem

If you were successful at installing the updates and XNA Game Studio Integration you will now have a new menu item.. You will use this menu to connect up to your XNA Game Studio 4 project, to the content we create in the Mod Tool

The Importance of Low Polygon Count Models

NOTE:  Because you are actually working with almost a full copy of Autodesk’s SoftImage XSI in the free mod tool you will notice that you can do more complex models with higher polygon counts and things that go beyond the limits of XNA’s content pipeline for rendering models and animation.. We want to avoid this as you will find yourself with models and animations that incorrectly render when output to an XNA project.. To avoid this it’s best to follow the directions below before you start modeling.. If not you will end up having to convert your models which may mean you still run into models that don’t appear properly in your game unless you follow the necessary steps.  If you have art folks on your staff it is important to let them know up front of just what those  limitations are.. A high polygon count model is a bad thing for an XNA game. That doesn’t mean your detailing has to be limited it just means you have to plan for this when modeling..

Remember: The polygons we are referring to here are triangles. The models used in XNA  are composed of polygon meshes. Essentially: a collection of points in space and a connection pattern between these points that defines the outer 'skin' of your model. All of your models should be done with the lowest possible number of polygons you can get away with without losing visual quality. Fine details may be 'drawn' on the texture rather than actually modeled. Shading tricks can also make the model appear as smooth as a much higher polygon model. When using multiple meshes for you models, make sure to 'delete' all the NON VISIBLE faces. If you have  two intersecting spheres will have faces 'inside' one another. Those faces will never be visible, but are still be processed during rendering,

If you do have a very high polygon model and you are having problems with doing this manually go to the Mod Tool’s Polygon Reduction tool that is a built in feature and it will help you with this automatically.. It can be found under  “Modify -> Poly. Mesh -> Polygon Reduction

Next Steps..

Next we are going to make sure we have set up our project in XNA Game Studio..

So I open XNA Game Studio 4.0 and create a new project for this project I will create a “Windows Phone Project”

image

Then our project will open up.. In the project you will find actually 2 projects a regular coding project and a content project for content that will make it into the XNA content pipeline for rendering.. All gaming “assets” aka (images, movies, 3D meshes, 2d, audio)  will end up on the “content side” of the project..

image

Adding Content to our Project

Next we want to add a couple of new folders to our project, one called “models” and the other called  “textures”.. To do this go into our content project and add two new folders by right clicking on the “content” project and on the pop-up menu selecting “Add New Folder..”

newfoldervs2010

Next we are going to add in content to our textures folder..

We can add graphical 2d textures for later use on our objects (such as .PNG files) to this folder. We can also add  “.FX” files and “.HLSL” Shader files.  Shaders define the surface qualities for a surface. As well as map files to allow us to do things such as luminosity maps, masks, etc. on our textures.

For our project to render and map out properly we are going to have to add in some of the supplied DirectX 9 type shaders that are supplied as part of the mod tool to our XNA Project.. We can find these at:

C:\Softimage\Softimage_Mod_Tool_7.5\Addons\XNAGSE\Data\XNA_SAMPLES\FX

addexisting

After doing so you should find this in your project:

image

These are the “default” mappings and effects that the Mod Tool supplies that must be in your project  for output to look correctly when running in XNA.. You must use these only because the rest supplied are for the image (non real-time) renderer supplied for non-game development purposes. For our project we can also “remove the .FX files because they won’t be necessary for our project at this time..

Now we have all we need to get started so we can go back into the Autodesk SoftImage Mod Tool and connect up this project so we can get started..

From either the XNA GAME STUDIO menu or the XNA TOOL bar we select  “Connect to XNA Game Studio.."

xnaconnect

..This is where we have to remember where we parked folks.. Selecting either will come up with a new dialog asking us to “LOCATE” the XNA Game Project that Visual Studio/2020 XNA Game Studio 4.0 created for us..

image

After we click on the “”  button and browsed and located our project (make sure you saved first in Visual Studio/XNA Game Studio 4) and selected it, in the information window below you will see the message “A valid XSI project has been detected at that specified location. This project will be set at the active project.”

Now you are connected and ready to get started modeling..

OTHER XNA INTEGRATION MENU OPTIONS

menuoptions

Create Model and Create Skinned Model

You should always start your XNA models from this menu using Create Model or Create Skinned Model..

If you do have models that you need to import remember what we said about high polygon counts and import them into your XNA project using the Convert to XNA Model. You may still have problems with your model confining to the requirements of the XNA environment. To help you with this there are some more menu options.

Conforming your Models to XNA

there is a “Diagnose Models” option which will tell you what is wrong with the models and gives you a report that helps you to correct problems that will effect  your models display in the XNA environment.

Once you have all of the problems worked out with your models there is a “PUBLISH Models” option that lets you publish the models as they are at the moment and store them inside your XNA project for further project work.

If you have went as far as to model and animate there is also a “Manage Animation”  menu option available.

After you have done all of this if you reopen your Visual Studio 2010/XNA Studio 4 project you will notice an XSI folder under the content. It may not be directly visible in the project but you can browse to the project’s folder location in windows explorer and know it’s all there..

Creating a model starts part 3 of our XNA Game Studio Deep dive..

Coming soon..