Introduction to Face Shadow Textures
Create a Face Shadow Map
1. Hand paint the map
First, according to the uv unwrapped face, draw 9 textures. In the Face mode of ASP/Character shader, there is an option to select the UV channel used by the texture (UV0~UV3). Therefore, you can choose to use the existing UV channel in DCC or do uv unwrap in the new UV channel based on the face shadow texture.
Divide the light angle of 0~180 into 9 angles, and draw 9 textures according to the change of the light angle on the single side face.
Finally, import the 9 drawn pictures into the Unity project.
<aside>
💡 It is not restrict to 9 textures (as long as total texture is more than 2). The more textures, the more detailed can be control under different angles of light. The less pictures, the lower the controling, and there will be a larger jump of light and shaded area change when the light angle changes. (From the previous texture to the next texture)
</aside>
2.Baking and Merging SDF Textures with ASP SDF Generator
Use the SDF Generator
- Open the SDF Generator:
- In your Unity project, navigate to the top menu bar.
- Click on "Tools/ASP" and then select "SDFGenerator" to open the SDF tool's window.
- Add Source Textures:
- Locate the 9 textures you want to use for generating the SDF(made in previous section).
- Drag and drop them directly into the "Source Textures" field within the SDF Generator window.
- Set Generation Settings:
- GroupName:Â In the designated field, provide a name that will be used as the prefix for your generated texture files. This helps you organize them.
- GeneratePath:Â Choose the path in project where you'd like your generated textures to be saved.
- Generate and Merge SDFs:
- Click the button labeled "Create SDFs & Merge". This will:
- Calculate individual Signed Distance Fields (SDFs) based on your 9 source textures.
- Combine these SDFs into a single texture, creating your final SDF-based face shadow map.