Clothing Items Documentation
Contents
- 1 Asset creation pipeline
- 1.1 General workflow for creating assets for Characters
- 1.2 Maya pipeline
- 1.3 Item properties
- 1.4 BlendShape Types
- 1.5 Unique geometry Items
- 1.6 Base geometry with blendShapes
- 1.7 Import decimated hipoly mesh into Maya
- 1.8 Make a copy of base geometry and wrap it around hipoly
- 1.9 Make a blendshape on the base geometry
- 1.10 Bake textures
- 1.11 Export
- 1.12 = Game Editor pipeline
Asset creation pipeline
Our character and animation pipeline is based on Autodesk Maya at the time of writing this wiki. However it does not matter where you will create the geometry for characters (3Ds Max, Maya - whatever) - every geometry has to be skinned, rigged and exported in Autodesk Maya (other software possible but untested).
General workflow for creating assets for Characters
- Hipoly mesh in ZBrush / Marvelous Designer
- Retopology in ZBrush, Maya or 3Ds Max
- Binding to skeleton and skinning in Maya
- Export to Cryengine from Maya
- Texture and material definition in Photoshop, Substance painter/Designer or Quixel Suite
- Create the Item in Wh_Clothing_Element_Editor
Maya pipeline
- male (Data\Objects\characters\humans\skeleton\male.mb)
- female (Data\Objects\characters\humans\skeleton\female.mb)
- child (currently unsupported )
- horse (WH\Data\Objects\characters\animals\horse\horse.mb)
For more information about the skeleton go to here.
Preparing geometry for export
There are two types of geometry you can use for an item
- used for both types of body slot (see Body Slots ) as an unique geometry, which does not have any blendshapes as a variant (see NPC Character ) like hats, glowes, plate armor etc. This item could be just binded to the skeleton and exported as it is. *
- this geometry is a container for storing more than one clothing item in one geometry. This is used mostly for 1st ,2nd and 4th layer of body and legs body slot. Since those items like shirts, pants, gambesons or waffenrocks are very simple shapes we're using just one geometry while variety of shapes and silhouettes is achieved with blendShape targets.
Item properties
Unique or Base geometry has to have certain properties to work properly in Clothing System. These properties are blendShapes of a various type
BlendShape Types
- Proportion blendshape
- it is used to add different proportions to the characters. We have 3 of them so far
- Fat
- Normal (Default)
- Slim
- name of this target always begins with prefix "P_" followed by actual proportion. Since the "normal" proportion is default, we have just two of them P_Fat and P_Slim - this target is always Additive to the Variation target. It means that P_Fat or P_Slim will be added on tom of V_ targets and is generic - one for all - there is a possibility to make custom variation target for P_Fat or P_Slim. For example P_Fat is not working well for V_006. So we can create custom V_006_Fat which will be used instead of V_006 automatically in game.
- Adapting blendShape
- it is most important blendShape target for "Raycast" deformations in game. Without this target Item will not be deformed by other clothing layers - its name is A_Shrink (it is basically item geometry shrink-wrapped to the body
- Variation blendShape
- this blendShape could be only on Base Geometry with blendShapes - defines shape of the Item - its name always begins with prefix "V_" followed by number. For example V_001
Unique geometry Items
- Open up an existing scene from which we are exporting items (for example s1_clothing.mb) or create a new one from desired skeleton scene (for example male.mb) It should look similar to this:
- Import low poly geometry and name it correctrly. *Bind it to skeleton
- general rule of thumb is to use as less joints as possible. So it is good to set " bind to:> Selected joints "
- Max influences parameter has to be equal or less than 4
- select the mesh and create cryExport Node.
- if you've named it correctly all you have to set is file type > Character Skin (.Skin) and correct name will be prefilled
now you have this hierarchy
- check number of vertex and UV maps. CryExporter supports just one vertex and one UV map per skinned mesh
- according to this page, we have to set the right vertex color. If you're not sure just make all of the verticies white (RGB 255, 255, 255)
- assign material
cryexporter can't read material from mesh for some reason (i believe it's a good reason) so we have to set material group before export
it is good idea to use as less materials as possible to keep scene clean. In our s1_clothing.mb scene we have one material group calledwh_geometry which currently holds 6 materials.It corresponds to the mesh with highest amount of materials.
In case you are using scene which already has material groups and you have mesh which needs just one material , assign first one from wh_geometry group (facialShader)
If you are exporting from your own scene, create material group with Mat.Ed tool from Crytek Shelf and hit Add Shaders From Selected Geom
if the mash has material which is not in any of your material groups, exporter will not export the mesh
- Export the mesh
- make sure, that 8 weight skin is unchecked (however we're supporting more than 4 weights per vertex ,even if you have more than 4, don't check this. It's crytek's feature and we are bypassing this in code since we are compressing vertex informations somehow - ask lead programmer how it works in code;)) - meshes are exported to the maya scene folder by default. So if you are using s1_clothing.mb it will be exported to ..Data\Objects\characters\humans\cloth\
- now you're ready to create clothing item in WH Clothing Element Editor
Base geometry with blendShapes
It has been said, that first two layers on each body part is probably very simple shape. We're using one geometry with blendShapes for those cases. For example p2_l1 (liner on body). There are all shirts and gambesons stored in one geometry. We can definitelly create tons of shirts from single topology - we call that topology "base geometry" for given layer and body part. Let's say we heve new base geometry without any blendShape yet. In other words no shirt or gambeson. Lets create one.
There is an image below showing base geometry for p2_l1_v0 without blendShapes
As you can see mesh is going all the way down so it can store blendShapes for long shirts as well as short ones. If you're working on short one, everything outside of the hipoly boundaries will be masked off in the diffuse texture and clothing system will cut unused polygons automatically in the game. So as an example we will create variation blendShape for short-length shirt. Simple step summary below. *bind base geometry to the skeleton and skin it properly (see Unique geometry Items)
- import decimated hipoly mesh into Maya *make a copy of base geometry and wrap it around hipoly
- make a Variation blendshape on the base geometry *bake textures from source hipoly to new blendShape geometry (normal map, optionally diffuse or other channels - see Texture Baking for Clothing Items) *export base geometry
Import decimated hipoly mesh into Maya
We have Hipoly mesh (created by Michal Hoz) which has almost 13 milion verticies. Decimate this mesh in Zbrush to something around 100k verticies to keep the work fast and easy enough</div>
Make a copy of base geometry and wrap it around hipoly
It is not a good idea to make blandShape Target on the original skinned geometry, so make a copy of s1_p2_l1_v0 just by pressing Ctrl + d (duplicate) and name it somehow. Than make the hipoly mesh "Live" (see image below)
Make a blendshape on the base geometry
Once the mesh is wrapped you can create the blendShape Target. If you are creating new blendShape deformer like in this case, your target name should be "V_001" because it is the fitrst one. So you can rename wrapped geometry to V_001. Select V_001 than add s1_p2_l1_v0 to the selection and create blendShape deformer. Name it to something like s1_p2_l1_BS for better finding among other deformers. Now you have base geometry with your first Clothing Item target ;)
Bake textures
see Texture baking of Clothing Items (Site not exiting yet)
Export
This step is the same like exporting Unique geometry If you don't have cryExport node created yet, create one and export the mesh. You have to check number of Vertex and UV maps and set them correctly like for Unique geometry. </div> </div> </div>
= Game Editor pipeline
To start putting clothes on the NPC you need some clothing geometry (.skin file see Maya pipeline) from which we'll create Clothing Item in Wh Clothing Element EditorWh Clothing Element Editor
Clothing Item in our game consists of several properties like name, model (.skin file), material, blendShape, archetype, race etc. To create such Item and save it to the database you will need Wh Clothing element Editor
None of your exported meshes will be used in game, until you define an Item in this editor.
Kingdom Come: Deliverance: Forum | Before you start | Tutorials & Instructions | Basic Mods | Tools | Documentation | Glossary | EULA |