HowTo/Create a 3D Avatar

From TrainzOnline
< HowTo(Difference between revisions)
Jump to: navigation, search
(Optimisations)
 
(8 intermediate revisions by one user not shown)
Line 4: Line 4:
 
The first step is to take a couple of photos. It is important to follow these steps very closely or quality will be reduced.  
 
The first step is to take a couple of photos. It is important to follow these steps very closely or quality will be reduced.  
  
 +
[[File:Front_bjorn_.jpg|thumbnail|200px|left]]
 +
[[File:Side_Bjorn_.JPG|thumbnail|200px|left]]
 
===Lights, Camera, Action===
 
===Lights, Camera, Action===
 
The key to getting a good in-game image is to take good photos. This means having a plain wall behind the subject, and taking a head-shot that includes just the head and part of the shoulders. It is also important to ensure the lighting is neutral. This means no heavy shadows on one side of the face, or bright spots with light reflecting off the skin. Do not use a flash. The photos below were taken on a standard phone with a resolution of 3 Megapixels.
 
The key to getting a good in-game image is to take good photos. This means having a plain wall behind the subject, and taking a head-shot that includes just the head and part of the shoulders. It is also important to ensure the lighting is neutral. This means no heavy shadows on one side of the face, or bright spots with light reflecting off the skin. Do not use a flash. The photos below were taken on a standard phone with a resolution of 3 Megapixels.
Line 9: Line 11:
 
===Front and Side Images===
 
===Front and Side Images===
 
We require a Front shot and a Side shot just as shown below. You will need someone to help you take the photo to ensure the subject fits nicely into the frame.
 
We require a Front shot and a Side shot just as shown below. You will need someone to help you take the photo to ensure the subject fits nicely into the frame.
[[File:Front.png|thumbnail|200px|left]]
+
 
[[File:Side.jpg|thumbnail|200px|left]]
+
 
 +
{{clear}}
 +
 
 +
[[File:Avatar1.jpg|thumbnail|500px|left]]
  
 
==Creating the Head and Texture==
 
==Creating the Head and Texture==
We are using software called Facial Studio. Using this software it is very easy to import the Front and Side images then customize the head to match the shape of the subject. This software also creates the 2D texture that we will use to wrap onto the head in 3D Studio Max.
+
To turn our 2D photos into a usable texture, we are using software called Facial Studio. We import the Front and Side photo images then adjust various control points to customize the head to match the shape of the subject. When moving the control points, the "Show Texture" option should be turned on so that you can see your progress as you tweak the mesh shape. The better the adjustments in Facial Studio, the closer the iamge will be to the original photo. It is also a good idea to keep the original photo open for reference to ensure you are getting the shape of the nose, mouth, chin and eyes correct.
  
Once the head is shaped and texture mapped, the items need to be exported. Export the face texture at 1024x1024, the eyes at 128 x 128 and export the head as a FS.obj.  
+
Once the head is shaped and texture mapped, the items need to be exported. We export the face texture at 512 x 256, the eyes at 256 x 128 and export the mesh as a .fbx file for importing into 3D Studio Max.
 +
{{clear}}
 +
[[File:Avatar3.jpg|thumbnail|500px|left]]
  
 
==Tidying up the Image==
 
==Tidying up the Image==
Once the texture map is created, there is likely to be a little bit of touch-up work to ensure the image is of the best possible quality. This means using Photoshop and adding some texture to the back of the head, touching up the ears and eyes, and possibly re-touching the skin colours to ensure good colouration.
+
Once we have our new texture map, there is a little bit more touch-up work to ensure the image is of the best possible quality. Firstly we need to add the eyes to the face map as we will have a single mesh in 3ds max. The ears tend to end up with black spots, so they can be tidied up, and of course we need to add some texture to the back of the head. Lastly, look at re-touching the skin colours to ensure good/even colouration and lighting. The end result is a single .tga texture for the head.
 +
{{clear}}
 +
[[File:Avatar2.jpg|thumbnail|500px|left]]
  
==Wrapping the Texture in Max==
+
==Importing into Max==
Again we are using special software to create our Max object. We have installed a Max plug-in for Facial Studio. This allows us to load the head and wrap the texture onto the head. We then need to stitch the head to a body and export using the Trainz Exporter.  
+
Open the .fbx file in max and ensure the correct texture map is located. To keep the poly count low, we need to remove the meshes for eyes, teeth and mouth (saving 2k polys). We also need to add a little bit of new geometry into the head mesh for the eye textures. The mouth remains closed and is not animated, so the existing geometry is fine.
  
==Creating a Trainz Asset==
+
==Additional work in Max==
Once the new avatar is created, we now need to create the config file that defines how Trainz will deal with the asset. A template is included below. All you need to do is replace the KUID with your own unique KUID, and rename the asset.
+
Once the head is complete, we then need to stitch the head to a body. This process is called welding and it involves welded the head seam to the neck seam of our selected body. We have several different body shapes to choose from. Once all this is done, we are ready to export using the Trainz Exporter plug-in.  
  
==Optimisations==
+
==Creating Additional LODs==
TBD
+
Once the first asset is created, we're ready to lower the poly count and create new Level of Detail meshes. Our top LOD is roughly 2k polys (1k for the head and 1k for the body). So we are aiming for LOD1 = 1k, LOD2 = 500 polys and LOD3 = 50 polys. Of course it makes sense to create the LODs for the bodies separately since they can be re-used with each new avatar created.
To ensure good performance in Trainz, we want to ensure that we leverage mesh-libraries where possible.  
+
{{clear}}
How many head and body types are required for uniqueness?
+
==Creating a Trainz Asset==
How many for optimum performance?
+
Once the new avatar mesh is created, we now need to create the config file that defines how Trainz will deal with the asset. Follow [[HowTo/Make your first Trainz Asset|these guidelines]]

Latest revision as of 14:43, 25 March 2014

This page explains the process that we go through to create a 3D avatar. Using similar tools and methods, you can follow this guide to create your own 3D image for Trainz.

Contents

[edit] Photo Source Images

The first step is to take a couple of photos. It is important to follow these steps very closely or quality will be reduced.

Front bjorn .jpg
Side Bjorn .JPG

[edit] Lights, Camera, Action

The key to getting a good in-game image is to take good photos. This means having a plain wall behind the subject, and taking a head-shot that includes just the head and part of the shoulders. It is also important to ensure the lighting is neutral. This means no heavy shadows on one side of the face, or bright spots with light reflecting off the skin. Do not use a flash. The photos below were taken on a standard phone with a resolution of 3 Megapixels.

[edit] Front and Side Images

We require a Front shot and a Side shot just as shown below. You will need someone to help you take the photo to ensure the subject fits nicely into the frame.


Avatar1.jpg

[edit] Creating the Head and Texture

To turn our 2D photos into a usable texture, we are using software called Facial Studio. We import the Front and Side photo images then adjust various control points to customize the head to match the shape of the subject. When moving the control points, the "Show Texture" option should be turned on so that you can see your progress as you tweak the mesh shape. The better the adjustments in Facial Studio, the closer the iamge will be to the original photo. It is also a good idea to keep the original photo open for reference to ensure you are getting the shape of the nose, mouth, chin and eyes correct.

Once the head is shaped and texture mapped, the items need to be exported. We export the face texture at 512 x 256, the eyes at 256 x 128 and export the mesh as a .fbx file for importing into 3D Studio Max.

Avatar3.jpg

[edit] Tidying up the Image

Once we have our new texture map, there is a little bit more touch-up work to ensure the image is of the best possible quality. Firstly we need to add the eyes to the face map as we will have a single mesh in 3ds max. The ears tend to end up with black spots, so they can be tidied up, and of course we need to add some texture to the back of the head. Lastly, look at re-touching the skin colours to ensure good/even colouration and lighting. The end result is a single .tga texture for the head.

Avatar2.jpg

[edit] Importing into Max

Open the .fbx file in max and ensure the correct texture map is located. To keep the poly count low, we need to remove the meshes for eyes, teeth and mouth (saving 2k polys). We also need to add a little bit of new geometry into the head mesh for the eye textures. The mouth remains closed and is not animated, so the existing geometry is fine.

[edit] Additional work in Max

Once the head is complete, we then need to stitch the head to a body. This process is called welding and it involves welded the head seam to the neck seam of our selected body. We have several different body shapes to choose from. Once all this is done, we are ready to export using the Trainz Exporter plug-in.

[edit] Creating Additional LODs

Once the first asset is created, we're ready to lower the poly count and create new Level of Detail meshes. Our top LOD is roughly 2k polys (1k for the head and 1k for the body). So we are aiming for LOD1 = 1k, LOD2 = 500 polys and LOD3 = 50 polys. Of course it makes sense to create the LODs for the bodies separately since they can be re-used with each new avatar created.

[edit] Creating a Trainz Asset

Once the new avatar mesh is created, we now need to create the config file that defines how Trainz will deal with the asset. Follow these guidelines