Roughly speaking, it is a human-powered Mesh Baker thing.
Specifically.
- Atlasize textures & reduce texture size
- Texture atlasing & material integration
This is a human-powered method of
1. when is weight reduction necessary?
When submitting 3D models for exhibition in Vket and other formats, there is a limit to the build size and number of materials.
For example, the following are the restrictions for submitting items for exhibition booths at Vket 2023 Winter.
- Build size: 2MB (texture space)
- Set Pass Calls (number of materials): 6
For simplicity of explanation, Set Pass Calls ≒ Number of Materials is used here.
If the exhibit exceeds this requirement,
a. Oversize build: Atlasize & reduce texture size
b. Excess materials: atlasing & material integration
and so on to reduce weight and meet requirements.
What this article does not deal with
When integrating multiple materials, it is necessary to successfully combine various parameters, matcap, etc. into a single material.
However, we will not deal with it here because it would be too complicated to explain.
2. what to do
The following is performed on the four hats with individual textures and materials.
a. Combine materials into one
b. Combine 4 textures (1024px) into 1 texture (1024px, 2048px)
The model used in the explanation is publicly available.
Please use it to check the procedure, etc!
2.1 Load and capacity check
We want to see the final effect of weight reduction, so let’s check the load before weight reduction.
Follow the steps below to check the statistics on the Game tab.
- Import unitypackage
- Run Play and open stats
Set Pass Calls
The “Set Pass Calls: 14” in the figure below is the load that increases with the number of materials.
Since 2 Set Pass Calls are used even when there are none, the number of Set Pass Calls for the hat alone is 12.
Build size
The following ” [2019 compatible] VRC Avatar/World Scales ” will be used to calculate the build size.
*There may be some errors due to differences in build size calculation methods. However, it is not enough to cause a problem.
Calculation Procedure
- Create an empty game object and rename it to Berets
- Put 4 colors of berets in Berets
- Right-click and select WeightScale
The resulting “Compressed Size” is the build size.
The build size before weight reduction was 1.34 [MB].
2.2 Moving UVs on a 3D model
*The hat model is extracted from a one-piece costume, so the UV is scanty.
First, create a hat model for 4 colors using the following procedure
(1) Import RibbonBeret.fbx in Blender
(2) Copy 3 imported models (make 4 in total)
Add color names to each model for clarity.
(4) Open the right tab of the view, set X, Y of the 2D cursor position to 0.5, and move it to the center of the UV.
(5) Pivot to 2D cursor
(6) Set all scales to 0.5 in the shrinking
(7) Move in 0.25 increments and place in blocks of 4 for each color.
Once completed, export and load the file in Unity.
2.3 Image & Integrated Material Creation
(1) Move the texture to match the UV of 2.2
(2) Normal map moved as well as texture
(3) Copy the existing material and replace it with (1) texture and (2) normal map
(4) Apply material (3) to the four hats in 2.2.
2.4 Load and capacity check again
The results of weight reduction are as follows
Individual material (2.1) Texture 1024 px each | Material Integration Texture 1024 px | Material Integration Texture 2048 px | |
Set Pass Calls | 12 | 2 | 2 |
Build size | Approx. 1,340[KB] | 853.46[KB] | Approx. 1.520[KB] |
Set Pass Calls
The drawing load could be reduced by 10, or roughly 15%.
In the case of identical 3D models with different colors, as in this case, Set Pass Calls are likely to decrease.
Build size
Naturally, the result depends on the texture resolution.
- Texture merging (2048px) results in larger build size
- Texture merging (1024px) results in smaller build size
Texture resolution is chosen according to build size limitations.
3. summary
Set Pass Calls (drawing load) could be reduced by integrating material textures.
However, if the resolution is maintained, the build size will be larger.
Therefore, if you want to reduce both Set Pass Calls and build size, you must reduce the resolution.
This time it was easy because we just combined the color variations into one.
In practice, however, I believe that in most cases the material parameters (shadow color, rim light color, etc.) are different, or there are not enough slots in Matcap.
In such cases, it becomes a trade-off issue between compromising the appearance or reducing the number of exhibits.
Deletion!
I hope this is helpful!