XSI ModTool to NeoAxis 





This tutorial describes how to make a simple neon sign 3D model in XSI ModTool and import it to NeoAxis. I will attach a C# class to that model to make it dynamic.

You will need the free XSI ModTool from SoftImage

Also install OGRE Exporter (OgreXSIExporter6_v1.4.6p1.msi) to your ModTool.

You will need a compiler to add a C#-class to NeoAxis. You can use the free Visual Studio 2008 from Microsoft.

(You can add the same logic to your model in NeoAxis Map Editor’s Logic Editor, but I find it difficult to use)

I will also use a texture from http://www.cgtextures.com and a sound from http://soundsnap.com. I also have installed a custom font to my Windows, so I can use that font in my model.

Noesis has made good tutorials on how to get familiar with ModTool or you can try the tutorials here http://developer.valvesoftware.com/wiki/XSI. I advice you to learn the basics of ModTool before you try this tutorial out.

If you are too elite hax0r for manuals and tutorials you might get by with just these few tips.

1. Press down ‘S’ and you can move and rotate the camera with left and right mouse button.
2. Press down ‘P’ and you can zoom in and out using left mouse button.
3. Pressing down ‘V’ lets you move your objects.
4. Pressing down ‘C’ lets you rotate your object.
5. Pressing ‘X’ lets you scale objects.

Keep in mind that I’m not an artist and this tutorial describes a process and it is not called “Making a masterpiece model that is super pretty tutorial”. I take no responsibility if you get hurt or my bad graphics damage your eyesight.

If in the tutorial some text is in italic that means it describes a button on your XSI ModTool panels. AKEY means you should press ‘A’ on your keyboard.

First open up your XSI ModTool and create a 3D box with Create->Objects->Cube.

Press UKEY to change RayCast Select to RayCast Polygon. Select the right side of your cube keep VKEY down and pull the side wider. Then move the front of the model back to make you cube flat. Here is an image of my cube and this will be the main body of our neon sign.



Now go around your model and select all the side faces of your model top, bottom and the 2 sides. You can do this by holding SKEY and rotating camera with right mouse button. You can select many faces by holding down CONTROLKEY when you click on your faces.

With all sides selected press SHIFTKEY + DKEY. This will open polymesh subdivide. Move the bar so that you have 4 iterations and then close the popup. Now all your side faces should be divided into 4 parts.

Select the front face of your model and scale it down by pressing down XKEY and left mouse button. Below is my version of the model with the front face scaled down.



Tadaa! Our amazing neon sign is half way there! Next we will add some text to our sign.

From the top menus select Modes -> XSI Default (Pro Mode).

Then press Create -> Text -> Solid Mesh

A popup opens and you can change the text and font from the bottom of that popup.




When you are finished just close the popup. After that change Mode back to Mod Tool from the top menus ‘Modes’.

Press SPACEBAR to go from RayCast Select to the default object selection mode and select the 3D text object.

Go to Modify -> Materials. Material manager popup opens up and then you will create a new material from the ‘Create’ top menu. Select ‘Phong’ as the material type. You now have a new material. You can change the name of the material if you want, but it’s not necessary. We are creating new materials in NeoAxis so it really doesn’t matter what their names are here. I named it ‘text’.

Doubleclick your new material and change the color to bright red. You can do this by dragging the bars in ‘Diffuse’ section of the material popup.




When you are satisfied close the popup and drag&drop that material over your 3D text. That applies your new material to the text. You 3D text should turn red now.

Then move and scale your text so that it fits inside your neon sign and it protrudes out from the board surface. XKEY to scale, CKEY to rotate object and VKEY to move it. Hold SKEY down and use mouse the check it’s in the right spot.

You can easily select object by using scene explorer. Press 8KEY to open it up and select your 3D text from there, if you have trouble selecting it in viewport. Here is a picture of my neon sign and the text fitted to the right place.



Now we want to add a texture to the sign board itself. Select the board mesh and press Create -> Textures -> Add -> Image. Popup appears and it has the default image on it with letters and numbers. In ‘Image’ section press new -> From file… and find the texture you are planning to use. In the ‘Texture projection’ section press new -> Unique Uvs. You can’t see the texture, because the view mode we are in is ‘Shaded’. On the top right of your viewport select the pulldown menu where is says ‘Shaded’ and change the mode to ‘Textured Decal’. You should see the texture on our image now and you can close all popups.



Now the texture look a bit too funky and we should maybe move it a little.

Press Create -> Textures -> Edit -> Projection and a popup opens up. You can see now how our model is textured and which part of the model gets what piece of the texture. If you are seeing the default image with colors and numbers change to the right picture from ‘Clips’ menu on top of the popup.

Use the familiar VKEY, CKEY and XKEY to move your models texture projection over that image.

Here is my version.



When you are done close the popups.

Now all we have to do is merge all this together and export to OGRE.

Open up he scene explorer with 8KEY. Holding down CONTROLKEY select both meshes. Mine are name cube and polymsh.

Press Create -> Mesh -> Merge. This will merge the two meshes together and it might look funny, like the textures and materials merging too, but we will fix it the net step.

If you closed your scene explorer open it up again with 8KEY. There is a new mesh called ‘polymsh1’. Inside it you can find ‘Polygon Mesh’ and under that ‘Merge Meshes’.



Doubleclick on ‘Merge Meshes’. A popup opens up to change merge values. Pull the ‘Tolerance’ bar so zero. In ‘Materials, Uvs, VertexColors,WeightMaps’ section press Merge. In ‘Inputs’ section press Delete to delete our original meshes. Now we have only our new mesh left. You can right click on it in scene explorer and rename it to ‘NeonSign’.

Now we could ad lights to the scene and get their effects rendered to the exported textures, but I don’t want to do this. Create lights with Create -> Objects -> Lights -> Point and place them around the scene if you want to. CONTROLKEY + DKEY will duplicate objects, if you want ore lights than one. My results looked so weird and I decided not to use any lights.

We are now ready to export our model to OGRE. First we will create a new texture that our UV-mapped mesh will use. This is something you would like to do, if you have a multitude of materials and textures for your model. You would only have one after this step. In this case this might feel even unnecessary.

With our mesh selected press Create -> Property -> Transfer -> RenderMap. A popup opens up with RenderMap values. Pull Super sampling’ bar up to 5 in ‘Format’ section. Select our UV-projection in UV-pulldown menu in ‘Format’ section. Select .PNG as your picture format and choose a path for the new texture.

If you added some lights to your scene their effect is produced on the new texture. You can see in the ‘Map’ section that ‘Illumination’ is selected also.



After you are all done press Regenerate Maps button on the top left corner.

This might take some time, but eventually (and if the ModTool doesn’t crash) you get a new texture in the folder you supplied. This is my new texture.



The line in the middle is a bug in XSI ModTool. It is not visible in XSI Foundation. SoftImage is investigating it and they have promised a fix for this.

So now have only the mesh to export. Select our model and from the top ‘File’ menu select ‘Export’ and choose ’OGRE mesh/skeleton’. This opens up a popup to choose our export properties. I want it to go straight to NeoAxis so I press the 3 dots button and create a new folder in my NeoAxis Data-folder.

C:\Program Files\NeoAxis Engine Non-Commercial SDK 0.53\Game\Bin\Data\Models\NeonSign

I change the ‘Tangent Semantic’ to ‘Texture Coord’ and at the bottom of the popup in change the ’Reduction Value’ to zero. Otherwise it will strip details from our model.



Then just press OK. After exporting is done save your scene from ‘File’ menu and then you can close ModTool.

After that I got a nice free electric sound from soundsnap.com and moved that sound with the Neon.png texture to the folder where my mesh went.

I already programmed a class to take care of the neon sign light flickering and playing a malfunctioning sound. You can download that C#-class from this link. Put in the \Game\Src\GameEntities-folder. Then open up NeoAxis solution in Visual Studio. Right click over GameEntities-project and choose Add -> Existing Item… and find you new NeonSign.cs class. This added the class as a part of he project. Press F6KEY and the project should compile and build. This compiled NeonSign.cs as a part on GameEntities.dll. Now we can use it in Resource Editor. Isn’t programming easy and fun! You can now close Visual Studio.
Open up your Resource Editor and find the folder where your new NeonSign.mesh is. If all went well you should see it without textures.



Right click on the NeonSign folder and create a New Resource, select Material as the type and give it a name NeonSign_body. Select ShaderBaseMaterial as the type of this material.

Doubleclick on you new material and in it’s properties set DiffuseMap1 to point at the texture file we made in ModTool.



Create two more highmaterials the same way. Name them NeonSign_off and NeonSign_on. Just don’t add any DiffuseMaps to them. Just change the DiffuseScale on the so other is bright red and other is black.



Now doubleclick on our mesh to change it to edit mode. In the meshes ‘Properties’ window collapse the SubMeshes attribute and you will see that the board of the neon sign is one mesh and the text is another sub mesh.

Change the materials on these sub meshes so that they point to our NeonSign_body and NeonSign_on materials. Now you should see out model fully textured.



Now we only have to create a .type file for this mesh and we can use it in one of our maps. We could use it as a static mesh, but that wouldn’t be very much fun now would it?

Right click on the folder again and create a new type. Select Entity type and NeonSign as the base class. There will be no NeonSign in the list, if you did not compile the GameEntities project successfully. Give your type a name NeonSign. Now doubleclick on your new type to change it to edit mode. Right click on the middle of the screen and select ‘Attach Object -> Mesh’ and select our NeonSign mesh.

Select ‘Attached Mesh’ properties and change the rotation to 90 0 180 and scale to 0.5 0.5 0.5.



In the NeonSign-type’s properties change AllowEditorCreate to ‘true’ and in the NeonSign section of the properties change the values to fit your sounds, materials and flickering delays.



This .type is now locked and loaded we are ready to test this on a map. Close Resource Editor and open up Map Editor. Place your NeonSign on some of the maps and run simulation to watch it work. Here is my final model placement on the map.



And here is a 5MB xvid encoded avi where the sign flickers.

I hope this helped some of you people out and as I said before this tutorial was about exporting models from ModTool to NeoAxis and not a tutorial on how to make perfect props for your game.

--Wellu

Here is the tutorial in PDF format for those who need to zoom the text.

Tutorial.pdf (2.45 MB)

Tutorial.zip (1.98 MB)