What you will need
- A copy of a 3D Modelling Software. For the purpose of this tutorial, I've used 3D Studio Max
- A Raster Graphics package. For the purpose of this tutorial, I've used Photoshop. Free tools such as GIMP are available here.
- The ColladaMax plugin
- The NVIDIA DDS Plugin
- Fully rigged Male / Female avatar models
Modelling Custom Clothes
Start with the Male/Female avatar 3DSMax scene files. We will use the avatar model to create our custom clothes design- in this case a Jacket.
To start, you may hide the Biped using the Layers Panel. Select the avatar model, and then select Editable Poly in the Modify Panel as shown below.
Now to create your Jacket, select the Edit Faces Mode and then select the Scale tool. Hold down Shift and scale the selected faces outwards in all 3 dimensions. When you release your selection, select Clone as Object, as name your object as Jacket.
You may notice that your Jacket is too big in some areas for your avatar. Select Edit Vertices or Edit Faces in the Edit Poly Tab, and turn on Soft Selection. Now Edit your new Jacket so that it fits your avatar just right.
Laying out the UVs
This Section explains how you lay out your UV Map which is the coordinate space for your Textures. It's important to lay out your UV Map so that there is no Texture Warping.
The video tutorial available here, goes over some important techniques and tools for Laying out UV Maps for Organic Models such as your Jacket. You will use the Point to Point Seams, Edit Seams, Relax and Planar Mapping Tools to layout the UVs for your Jacket.
TIP: Apply a standard Checker material while working so you can see the results of your UV Layout Dynamically.
Once you have laid out the UVs, Select Render UVW Template to render your UV Map.
Rigging your Custom Clothes
This Section details the procedure to use the Skin Wrap Modifier in 3DSMax to Rig your custom designed clothes to the Avatar. This process is fairly simple.
Select your Jacket and add the Skin Wrap Modifier in the Modify Panel as shown in the Figure below. For the first step set the following settings-
The above settings allow your custom designed clothing to very closely follow the Avatar as it moves. For the second step, click Add and add the Avatar (m_fullbody) as shown in the Figure below.
For the final step, click the Convert to Skin button. Your custom designed Jacket is now rigged to the Avatar.
TO DEMONSTRATE: Select the Biped, and click the Motion Tab. Turn off Figure Mode, and slide the Marker around on the Time Bar. The arms of your Jacket will now follow the Avatar's movement.
Texturing, Normal and Specular Maps
This Section will provide useful information on creating clothes textures using Photographic References.
There are great Tutorials available online for creating Texture Maps for game engines. For your custom Jacket, you will need to create a Diffuse(Colour) Map, Normal and Specular Maps. If you're not familiar with these Texture Maps, you could use an introduction to them.
As for Tutorials, get started with the tutorials located here and here. Creating Texture Maps for games is a prized skillset, so take your time with this stage of the process creating your custom clothes.
This section details the Material to be applied before your custom clothes are ready for export to Twinity.
First create a Multi/Sub Object material. Set the number of slots to two. You will use DirectX Shaders for each of the two slots. The figure below shows the configuration of the Materials Editor window.
The DirectX Shaders (.fx files) that you will use are located in your Twinity Install directory, and are detailed here-
Apply the Material to your custom Jacket and you can view the results in the Max Viewport.
This section details the procedure to Export your completed custom clothes to Twinity. First, hide all objects apart from your custom designed Jacket. Use the Layers Panel to do this. This is very important.
Next, export your completed Jacket to the .DAE (Collada Format) using the Export function in 3DSMax.
Editing the twml file
The TWML Specification lists fantastic examples to add your Custom Animations to your Avatar. Section 188.8.131.52 is an example of exporting Pants. Refer to the Clothing Slots section 184.108.40.206 for the different types of Clothing and Accessories that are supported.
POINT TO NOTE: Ensure all of the Export Files (i.e. the .twml, .dds, .dae, .max files) are at the same location for simplicity.
Refer to the Downloads section for the sample twml file and 3dsmax scene file.
Using your Custom Clothes in Twinity
To wear your custom designed Jacket, select the option to Customize your Avatar's Look. Select My Computer, and navigate to the location on your computer where the twml file is saved
POINT TO NOTE: You need to be a Premium Member to upload Customized Content to Twinity from your computer.
Select the twml file you have created, and then click Apply.
<package caption="Jacket" icon="icon.jpg"> <description>Funky Jacket</description> <clothes path="jacket.dae" skeleton="male"> <clothing_slot type="top"/> </clothes> </package>