Ta-da! It's Mamepon!! Entering my 5th month of VRC, I've realized I've recently become an intermediate VRC user, having surpassed 1000 hours of playtime, started event casting, and begun tinkering with Blender.
In the midst of this, I had the opportunity to speak to event casters about my specialty?!—optimization. Since I'm at it, I'd like to summarize my knowledge in a note for users who have been in VRC for about 6 months and are starting to do optimization.
Of course, if you want to gain knowledge, please start from "Thoughts on Avatar Optimization", and if you just want to optimize for now, please start from "Methods for Avatar Optimization".
I hope this article sparks some development or discussion in VRC culture. If you have any insights, please leave a comment!!! Let's get right into it!!!!
Mamepon's VRC Account
Thoughts on Avatar Optimization
Purpose of Optimization
There are two main purposes for avatar optimization: '1. Improving performance on Windows' and '2. Supporting display on Android and iOS'. These two have completely different levels of difficulty, and when trying to maintain minimum quality, 2 is overwhelmingly more difficult compared to 1. It's a question of how far you go, but since it can lead to lowering the quality of the avatar, decide which one you are aiming for first.
Improvement of avatar display speed and rendering speed on Windows
Avoiding avatar display culling on Android, iOS, and Quest
Client Resources
In VRC, there are servers, which are resources secured by the management, and clients, which are resources secured by users. There are different types of clients, and in the case of VRC, devices like Windows, Android, iOS, and Quest count as clients. These have computing resources such as Memory, CPU, and GPU, and exchange data using your home network. The following elements affect each resource.
Network (downloading compressed files)
Memory (unzipping texture sizes and material counts)
CPU (execution of skinning, animation, and physics calculations)
GPU (rendering of shadow shaders and particles)
Image of Resource Usage
Roughly speaking, resources are used in the following flow. You download the compressed avatar file via the network, unzip it to load the avatar into memory, use the CPU to calculate the position coordinates of the armature, and use the GPU to calculate the rendering of shadows and particles. I haven't drawn it in a diagram because it gets complicated, but finally, the memory is updated and rewritten with the updated coordinates and rendering content.
Performance Rank
This part is quite important, so if you are thinking about supporting Android, iOS, or Quest, please open your ears and listen carefully.
If you look at the following documentation, it is divided into PC Limits and Mobile Limits, and the performance targets differ for each. When aiming for optimization on Windows, I think it's best to aim for Poor or Medium depending on your goal. If you have the knowledge, you can actually hit these targets quite well. When aiming for Android, iOS, or Quest support, you have to aim for the PC Limits' Poor rank, otherwise the avatar won't even run. However, you don't actually need to keep the polygon count under 20,000 just for PhysBones. That said, you can't even upload it unless it's under 10MB, so the key is to adjust the textures and polygons nicely. If you work hard at it, you can usually cut the polygon count by about half, so try to keep the total for the avatar and outfit around 140,000.
Optimization for Windows: Aim for Medium or Poor overall
Optimization for Android, iOS, or Quest: Aim for Poor and under 10MB for PhysBones
Performance Ranks
The Impact of Important Optimization Metrics on Resources
I've written about this at length, but unless you're loading up on tons of gimmicks, the areas that affect avatar modification are fixed, and I think you'll be fine if you just pay attention to the following parts. Please keep an eye on these as they roughly affect the following resources. Having an extreme number of lights is unhealthy, so I think that's a no-go > <.
Download size: Network → Memory → CPU (decoding)
Texture memory: Memory → GPU (bandwidth/transfer)
Uncompressed size: Memory → CPU (I/O/expansion during loading)
Polygon count: GPU → CPU (during skinning) → Memory (vertex data)
Number of skinned meshes: CPU → GPU → Memory
Number of PhysBone components: CPU → Memory
Number of PhysBone transforms: CPU → Memory
Number of PhysBone colliders: CPU → Memory
Number of bones: CPU → GPU (in GPU skinning environments) → Memory
Thinking Methods for Optimization
This is also very important, and there are broadly only two ways to think about optimization in avatar modification. They are deletion and consolidation. To use strong words, it's "if you can't see it, you don't need it, so don't render it" and "don't bring in the same thing, one is enough." Don't load unnecessary components in the first place, and if there are multiple identical necessary components, combine them. That's really all there is to it. The top is the image before correction, and the bottom is after.
Delete unnecessary components
Consolidate necessary components
How to reduce textures, polygons, and PhysBones
Generally, I tend to perform optimization in the following order: 'overall optimization,' 'polygon reduction,' 'texture reduction,' and 'PhysBone reduction.' I will explain the tools in detail later, but since creators aren't aware of every single Unity extension in existence, I feel it's best not to use multiple tools of the same type—especially those that run during the Build process—across polygons, textures, and PhysBones. Though, sometimes you can.
-
Overall
Set to EditOnly to prevent unnecessary objects from loading → Unity
Optimize by merging or deleting unnecessary files → AAO
-
Polygons
Reduce polygons by hiding parts that aren't visible so they don't load → Unity
Reduce by simplifying polygon counts → AAO
-
Textures
Delete unnecessary textures by baking and merging images → Unity
Reduce texture size by optimizing texture quality and layout → TTT
-
PhysBone
Reduce PhysBones by turning off scripts for unnecessary armatures → Unity
Standardize by setting scripts with the same parent armature to the same settings → AAO
-
Shader
Convert by limiting to shaders usable on Android → VRCQuestTools
Concept of optimization
Polygon optimizationHonestly, I don't put much thought into polygon optimization; I simply perform optimization by "deleting invisible polygon parts" and "lowering the quality of visible polygons." Both can be easily executed using tools. There is really nothing more to say. This affects the compressed size, uncompressed size, physics calculations, and rendering, so it impacts overall resources.
Texture optimizationAs a prerequisite, textures are composed of pixel sizes and colors. A 1024 * 1024 size and a 2048 * 2048 size have side lengths that differ by a factor of 2, so the area is 4 times larger and the capacity is 4 times larger. Also, since each parameter in RGB has an allocation of 0-255, and transparency also has an allocation of 0-255, the capacity of a standard RGB.png and a transparent RGB.png differs by a factor of 4/3. These are directly linked to compressed size and uncompressed size, so in terms of resources, they affect Network and Memory resources. Therefore, set the texture to a size that maintains minimum quality and try not to use transparency as much as possible.
Texture optimization can significantly reduce the number of files and size by combining multiple textures into one and eliminating gaps with optimal placement when "multiple textures are prepared" and "there are many gaps in the images." This is called atlasing and can be easily executed using tools. This also directly affects compressed size and uncompressed size.
PhysBone optimizationPhysBone optimization is a more difficult concept compared to textures and polygons. In VRC avatars, there is something called a PhysBoneScript, which is a script that manages swaying objects, and it can be shared if two rules are met: "1. The parent Armature is the same" and "2. All Script setting values are the same." In these cases, you can use a tool to combine them into a single Component. This is directly linked to physics calculations, so it mainly affects CPU resources. Since VRC is basically CPU-bottlenecked, I definitely want you to do this.
The parent Armature is the same
All Script setting values are the same
Also, regarding the number of Transforms, if a PhysBoneScript is attached to the parent Armature, it will propagate to all child Armatures. Therefore, be aware that if a PhysBoneScript is attached to the parent Armature and there are 3 child Armatures below it as shown below, 4 Transforms will be consumed. It is good to select and adjust the swaying objects when uploading at the end.
A quick breather questionAnswer how many times larger 2 is compared to 1. 1. 1024 * 1024 RGB transparent .png 2. 2048 * 2048 RGB .png A: It is 3 times larger, think about it
Methods for avatar optimization
Tools used for optimization
This time, we will perform optimization using the following tools. AAO is used for overall optimization, polygon reduction, and PhysBone sharing. Meshia Mesh Simplification is used for polygon reduction. TTT is used for texture sharing. The documentation is below, and you can download and install it from VCC or ALCOM.
AAO ver1.9.17 : Overall optimization, polygon reduction, PhysBone sharing
VRCQuestTools ver2.11.7 : Shader conversion for Android support
TTT ver1.0.2 : Texture resolution change and atlasing
https://ttt.rs64.net/
* I tried to promote it, but I'm a little sad that only this one didn't expand.
* I previously introduced Meshia Mesh Simplification, but since I found cases where it didn't work well with other tools, I rewrote it to rely solely on AAO.
Avatar Optimization Hands-on
Performance Check (Before Optimization)First, let's check the breakdown of performance before optimization. With a download size of 26.65MB, texture memory of 192.88MB, 206,376 triangles, and 52 PhysBone components, she's quite heavy. I'm going to optimize her so she becomes a 'lightweight girl' and won't be called tasteless even when walking around in public.
Changing the Entire Structure to Minimal
If you don't Untarget hidden objects or bake textures, unnecessary objects will be loaded and multiple textures will be loaded wastefully, so let's make it a minimal configuration.
Unity Edit Only
Unless you have animations set up and are intentionally loading them as hidden, you should set all objects to Edit Only.
Unity Texture Baking
If textures are registered not only in Main Color 1 but also in Main Color 2, such as for changing eye colors around the face, bake them and integrate them into one sheet.
Overall Optimization
Here, we will perform overall optimization. You should definitely do this as it can lighten the avatar without affecting its appearance.
AAO Merge Skinned MeshFirst, we will optimize the meshes. Right-click on the avatar body in the Hierarchy, select Create Empty, and create an empty object named AAO.
Add the AAO Merge Skinned Mesh component to the added empty object from the Inspector.
Once the AAO Merge Skinned Mesh component is added, you can reduce the polygon count by adding meshes to the Skinned Mesh Renderer section.
To perform the Mesh Merge, add a Skinned Mesh Renderer as a component of the AAO object. The Root Bone refers to the setting value of the Body Base object.
To add all meshes to the Skinned Mesh Renderer value of the AAO Merge Skinned Mesh, click the Skinned Mesh Renderers error in the VRChat SDK's Review Any Alerts, select all meshes, and drag and drop them.
AAO Merge Skinned Mesh will have the meshes selected as shown below, but since some objects may break, please keep an eye on them and remove objects as appropriate.
AAO Trace and OptimizeNext, we will optimize the PhysBones. Left-click to select the avatar base in the Hierarchy, and add the AAO Trace and Optimize component from the Inspector.
For the AAO Trace and Optimize component settings, check all boxes except for "Keep end bones." This will perform bone optimization.
Performance Check (After Overall Optimization)Let's check the performance breakdown after the overall optimization. The download size is 11.89MB, texture memory is 57.86MB, triangle polygon count is 176,224, and the number of PhysBone components is 45. It is still heavy, but it has become slightly lighter without sacrificing any visual quality.
This concludes the overall optimization. You can make your avatar slightly lighter just by doing this without changing its appearance at all. Therefore, when modifying, do not be lazy and make sure to do at least this much.
Polygon Optimization
From here on, we will aggressively reduce the polygons. We will reduce unnecessary polygons using AAO Remove Mesh By BlendShape and AAO Remove Mesh By Box, and push the quality to the limit using Meshia Mesh Simplification.
AAO Remove Mesh By BlendShapeLeft-click to select the avatar base in the Hierarchy, and add the AAO Remove Mesh By BlendShape component from the Inspector.
Looking at AAO Remove Mesh By BlendShape, you can toggle visibility for each Blend Shape, so check the boxes for parts that are covered by clothing and not visible.
AAO Remove Mesh By BoxAfter removing most of the polygons with AAO Remove Mesh By BlendShape, we will remove polygons in more detailed areas. Add AAO Remove Mesh By Box from the Inspector.
AAO Remove Mesh By Box is a tool that can delete polygons covered by a box. Prepare boxes for areas hidden by shoulders or skirts and reduce the polygons as much as possible. You can adjust the position of the selected box by pressing the "Edit This Box" section. When you are finished editing, please press "Finish Editing This Box".
In the case of my avatar, the lower and upper body were separate, so I set up AAO Remove Mesh By Box for each Body Base. You can delete the mesh in the area covered by the box, and you can set up multiple boxes. When you trim it to the limit, it looks like this.
Performance Check (After Polygon Reduction)Let's check the performance breakdown after polygon reduction. The download size is 11.35MB, texture memory is 55.20MB, triangle polygon count is 162,492, and the number of PhysBone components is 45. We succeeded in reducing the polygons slightly without dropping the quality. This will reduce the rendering cost of physics calculations.
Texture Optimization
Assuming that you have already baked items like eye textures, we will now group the textures, adjust their resolution, and perform atlasing.
TTT Atlas TextureRight-click the avatar's Hierarchy to open the menu, then select and add TTT Atlas Texture from it. Then, change the object name to Atlas Texture.
The component will be automatically created in the TTT Atlas Texture. Create and group Atlas Texture objects and components for the face, body, hair, clothes, and shoes respectively. I use the following settings. You can lower the resolution for small items and accessories that are far from the face.
Face: 2048px
Body: 2048px
Hair: 1024px
Clothes: 2048px
Shoes: 512px
Let's check the performance breakdown after texture reduction. Download size: 9.87MB, Texture Memory: 33.08MB, Triangle polygon count: 162,492, PhysBone component count: 45. I succeeded in making it lighter by reducing the download size and texture size. Since I was able to keep it under 10MB, it has reached a range where Android support is possible.
PhysBone Optimization
Assuming that unnecessary PhysBoneScripts have already been hidden, I will standardize the PhysBoneScripts and reduce the number of PhysBone components.
AAO Merge PhysBoneRight-click the avatar's Hierarchy, select Create Empty to add an empty object, and rename it to Merge PhysBone.
Add the AAO Merge PhysBone component from the Inspector of the Merge PhysBone object.
To check all Armatures that have PhysBoneScript components attached, select Phys Bone Components from Review Any Alerts in the VRChat SDK.
It will look like the following, so for parts where the "parent Armature is the same" and "all script settings are the same," add the Armature to the AAO Merge PhysBone component.
If the values are even slightly different, the following error will appear and you won't be able to use AAO Merge PhysBone, but there is a workaround.
Since the swaying behavior is different, it says that if you want to use AAO Merge PhysBone, you should match the values of the parts that set the swaying behavior, so I copy the settings of the script for the swaying behavior I want to match and force-paste them into another script to make them match.
By doing this, the values are matched, so the error is resolved, allowing you to use AAO Merge PhysBone and reduce the number of PhysBone components and PhysBone transforms.
There are many, but if you set AAO Merge PhysBone for all Armatures that can be shared, it will look like the following.
Performance Check (After PhysBone Reduction)Let's check the breakdown of performance after texture reduction. Download size: 9.83MB, Texture Memory: 33.08MB, Number of triangles: 162,492, Number of PhysBone components: 14. We succeeded in reducing the number of PhysBone components. Rendering of physics calculations on the CPU will become lighter. However, the number of Transforms has not decreased much, so if you want to reduce it significantly, you need to use Blender to reduce the number of Armatures. It is faster to narrow down and turn off the PhysBoneScript to stop the swaying.
Build and Upload for PC Version
For the PC version, there is no problem with uploading it as is for now. Even for those considering Android support, if you upload separately for Windows and Android, you won't be subject to the restrictions on swaying objects, so let's upload it for now.
Build and Upload for Android Version
If you are only planning to upload for Windows, you don't need to read this part. This is intended for those who want to support Android, iOS, and Quest.
The Android version has limited usable shaders, and familiar ones like liltoon or poiyomi cannot be used, so they need to be converted. VRCQuestTools handles this nicely by resolving conflicts with NDMF and executing the build in the correct order. Select 'Convert Avatar for Android' in VRCQuestTools under Tools, and add 'VQT Network' and 'VQT Avatar Converter Setting'.
I think various errors will appear, but most of them are likely errors that occur in the state before building without knowing the existence of AAO, so it is fine to ignore the VQT errors for now. The default is Toon Lit, but it is rich, so you might want to change it to Toon Standard depending on your preference.
Prioritize items with large swaying motions like hair and skirts, and limit the swaying of other small items so that the number of PhysBone components is 8. Also, if the upload size exceeds 10MB here, please reduce the texture resolution as well.
Let's check the breakdown of performance after Android support. Download size: 7.55MB, Texture Memory: 21.36MB, Number of triangles: 150,716, Number of PhysBone components: 8. We succeeded in reducing the overall elements.
Another point to be careful about with Android support is that special shaders, petting gimmicks, heartbeat gimmicks, etc., cannot be used on Quest in the first place, or they will cause errors due to hitting limits on the number of audio sources or lights, so turn them off.
Once you have reached this point, switch to Android, build, and try uploading. You will probably get some kind of error, but let's feed it into ChatGPT, Gemini, or Claude with a spirit of not panicking, not rushing, and not being lazy, and unravel it. Errors are your friends and your allies
Final Performance Breakdown
The left is before optimization and the right is after. I haven't changed the polygons at all, and I only slightly reduced the textures for hair and shoes, so the appearance is almost unchanged.
Also, looking at the performance breakdown, you can see that improvements have been made in all areas: polygons, textures, and PhysBone.
Even though I supported Android, I counted the swaying objects as low, so you can see that various parts like hair, clothes, and wings are swaying properly
Conclusion
In the four months since I started VRC, with the help of those around me, I have been able to acquire a lot of knowledge. Originally a web backend and infrastructure engineer, I was able to become conscious of client-side topics like apps and front-end, which I wasn't very familiar with, and now I can apply this to my work as well.
The trigger for me to gain knowledge about modification actually mostly came from my friend, the modeler Kawai-san, and it stems from the fact that I was able to learn various things in the process of being curious, researching, and trying things out. Kawai-san also mentioned that before starting VRC, they were not a modeler or anything, but that this knowledge was cultivated from the desire to meet various people, have fun, and express themselves while playing.
I believe this is an example of cultural evolution born from the cycle where individuals in VRC form communities through the overall aspects they create, receive value from those communities, and then give back to them. I felt strongly once again that fostering this flow is exactly what I want to do through OSS.
Thank you for reading until the end