Custom Hair - Raytwo/Cobalt GitHub Wiki
Preparing your model (Vanilla model)
To edit a hair model from Engage, you will need to use ( AssetStudio ) to get the model from the game's files. If you are importing hair from another game or creating hair from scratch, start here.
Make sure to specify the Unity version Engage uses, which is 2020.3.18f1
. Depending on which version of AssetStudio you are using, this may already be set for you.
In Export Options
, locate the option called "Export all UVs as diffuse maps". Export the model twice: once with this option enabled, and once with it disabled.
Then, open Blender and import both models. One of them should come only 1 UV map, but with vertex colors, and the other with both UV maps, but without vertex colors.
Next, transfer the vertex colors to the model that has both UV maps. First, select the mesh to copy to, and then select the mesh to copy from, as shown in the image below.
Then press "F3" and select the option "Transfer Mesh Data", and then "Colors"
And with this, you should have set a vanilla hair model with all the properties needed for it to work in the game.
Preparing your model (External model)
If you are going to work with hair that's not from Engage, you will need this "Blender Template".
In the Blender project, you will find a head model. You will need to adjust your hair model to fit over it. For example, here, I've adjusted Yunaka's twintails to match the head shape.
Vertex Colors
These are the colors Engage uses for various purposes.
Red Vertex Colors
This color is used for outlines. The bigger the red values are, the thicker the outlines will be. I recommend using 0.42
in the red channel as shown in the image below, since it is the average value for outlines found in the game.
Green Vertex Colors
Green is used for the intensity of the Gradation Color
, which means the stronger the green value, the more the gradation color will be seen in that area. I recommend using the values shown in the image below.
Blue Vertex Colors
Blue is used for Engage hair gradients, which means the higher the blue value, the stronger the Engage gradient color will be. I recommend using the values shown in the image below.
Multi Texture
A multi texture is what the game uses for its illumination.
- Red (Roughness)
- Green (Metal)
- Blue (Ambient Occlusion)
Every hair from the game uses the same multi texture, so you will need to work with the same texture added in the "Blender Template".
To properly add this multi texture on your hair, I recommend following these steps:
- Go to the "UV Editing" Workspace.
- Select the hair model in "Edit Mode", and make sure you have "UV0" selected first, and then select all the hair with "A" on the keyboard.
- Select "UV" and then the option "Project from view"
If all the previous steps were followed correctly, you should see the new UV Map on the multi image. Next, reduce the scale of the hair UV Map and leave it the pink part of the image.
Then, manually select all the faces that will act as the dark lines of the hair, and place them in the red zone of the Multi texture.
Angel Ring
The "Angel Ring" refers to the white areas in hair models that simulate light reflection.
Adding the Angel Ring to your hair.
To properly add the Angel Ring, I recommend following these steps:
- Separate the hair model into separate meshes first. (This is highly recommended for better results.)
Example:
I'll divide this hair in 5 parts to apply the Angel Ring Individually for each one.
- Make sure you have the front of that part of the mesh looking directly to the camera.
- Then will need to go to the "UV Editing" Workspace.
- Select the hair in "Edit Mode", make sure you have "UV1" selected first, and then select all the hair with "A" on the keyboard.
- Select "UV" and then the option "Project from view"
If all the previous steps were followed correctly, you should see the new UV Map on the Angel Ring image.
Next, move the UV coordinates around the image for how you want the Angel Ring to look like on the mesh. You can also change the scale of it if you want it to be bigger or smaller.
You must do the same process for every part of your hair model
Adding Physics (Springbones) to your hair
To add physics to your hair, follow this Guide.
Getting ready your model in Unity.
- Before exporting your hair, make sure your material is called "MtHair". The game requires it to be this name.
- Export your model as "FBX" at scale "0.01"
- In mesh settings, select this option.
-
Set up the properties from your hair mesh to your liking..
-
Make your bundle "Addressable" with this path.
Warning: Hair099a
is just an example. You must change it to another name that does not exist already in the game.
- Finally, once your bundle is "Addressable" go to the "Divine Dragon" window and pick "Build Addressables".