d4rkpl4y3r 的 VRChat Avatar 3.0 优化器
d4rkpl4y3r's VRChat avatar 3.0 optimizer that aims to reduce skinned mesh & material count.
Alternatively you can click the "Create Optimized Copy" button to create a new avatar with optimized materials and meshes. That way you can test the optimized version in editor to validate it works properly before uploading it. If everything works correctly you can then upload that optimized copy.
This button is the old workflow and I recommend against using it as it can't work properly with nondestructive tooling such as VRCFury or ModularAvatar.
To install the optimizer with VCC you need to add the url https://d4rkc0d3r.github.io/vpm-repos/main.json as a custom repository.
After that you can add and update the optimizer like any other packages in your VCC projects.
If you want to look into more detail there is an extra document here: For Advanced Users
Also read the preset & individual option documentation below.
This preset only uses optimizations that don't affect the behavior of the avatar (some exceptions apply)
This preset uses all the above & some new optimizations.
For this mode you should keep shaders unlocked as it can allow for more merging.
Expect the following behavior changes (reduced due to NaNimation toggles):
Some of the settings used here compromise quality of the avatar heavily when animations/shaders are blocked.
It has some more experimental & some behavior changing ones. Testing that your avatar still works as intended is very needed in this mode. If it doesn't work correctly switch to a lower optimization preset.
Shaders can do a lot of weird things, therefore the optimizer is bound to fail on some of them. Here is a couple things you could try:
If you are a shader author you can read the Guidelines for Shader Authors document to make your shaders compatible with the optimizer.
To make a bug report you need to find the generated assets in the trash bin folder. You can get them by clicking the settings button on the optimizer component and then clicking the button with the open folder icon.
Now your explorer should open with the trash bin folder open and a _TrashBin.zip file selected. This file contains the generated animation controllers, materials, shaders and the log file of the optimization.
Now you can make a bug report on the issue tracker by describing your issue and attaching the _TrashBin.zip file.
There are also some settings to tweak the optimization. You can read about their effects in more detail here:
Automatically applies the optimizer to the avatar before uploading it to VRChat. This is non destructive, the avatar in your scene will stay as it is.
This is very similar to what some shaders call locking in or baking. If you use this option you should disable the locking in or baking feature of your shader.
One exception to this is for materials that use the "Rename Animated" feature. These materials should stay locked in.
When enabled the optimizer will replace the uniform parameter definitions with a static value on all materials.
For example uniform float4 _Color; will get changed to static float4 _Color = float4(1, 0, 1, 1);
This enables the shader compiler to do more constant folding and thus making the shader run faster.
Unfortunately the shader compiler is allowed to ignore NaNs while doing that so if a shader is not made with that in mind this might cause some issues.
The optimizer tries to merge different skinned meshes together.
This usually means meshes which always get animated in the same way will get merged.
Skinned meshes that are on different layers (eg UIMenu) from each other will not get merged.
Skinned meshes that are disabled and have no animation to turn them on will get deleted.
Merges meshes even if their material properties get animated differently or if they get toggled separately from each other.
This will add logic to the shaders to ensure everything works correctly. Some shaders might not work correctly with this option enabled.
Can't merge meshes that have any tessellation or surface shaders.
Forces on Write Properties as Static Values if enabled.
Shader Toggles will not work with blocked shaders or projectors.
Merges meshes even if they get toggled separately from each other.
This will add an extra bone per original mesh that gets added to each vertex with a very low weight. This bones scale will be animated to NaN to toggle the mesh off.
Unlike the Use Shader Toggles option this does not require the shaders to be changed.
It also doesn't have the problems of projectors and blocked shaders not understanding the toggles.
Might cause some issues with name plate & chat box position. If they are inside your head / way too far above your head you should disable this option.
It can't merge meshes that use a WD ON workflow when they are off by default unless the toggles are simple enough that they can get optimized by Optimize FX Layer.
Allows NaNimation Toggles to be used on meshes that use 4 bone weights on some vertices reducing the skinning quality to only 3 effective bone weights.
You can see which meshes use 4 bone weights in the debug info section under Mesh Bone Weight Stats.
Any mesh that shows index 3 being used will be affected by reduced skinning quality if it has toggle animations.
Stops meshes that are enabled by default from getting merged with meshes that are disabled by default and vice versa.
This is useful to not look weird with blocked animations in case of NaNimation toggles. With this disabled and animations blocked all merged meshes will be visible.
Automatically converts static meshes to skinned meshes so that they can be merged with other meshes and have their materials merged as well. This only happens if the static mesh has materials that can be merged with materials from the skinned mesh it tries to get merged into.
Does not convert meshes on the UIMenu layer since they are mostly used for computation.
Allows multiple Skinned Mesh Renderers that reference the same mesh asset to be optimized independently. This can duplicate mesh data in the uploaded avatar and increase download and VRAM size.
When disabled, all Skinned Mesh Renderers sharing a mesh with more vertices than the global Shared Mesh Vertex Count Exclusion Threshold are automatically excluded from optimization. Their children are not excluded. The threshold defaults to 1024 vertices and can be changed in the Avatar Optimizer global settings.
Merges materials with the same shader where properties can have different values. If they do have different values the values will get written to a constant buffer. Material IDs get written to uv.z and used to access the correct value from that cbuffer.
If your shader has a "lock in" or "bake" feature, make sure to not use it with this optimizer if you have "Write Properties as Static Values" enabled. Locked in shaders will have different actual shaders for each material, so they can't be combined. "Write Properties as Static Values" will take over the job of locking in the shaders.
Can't merge materials if:
ZWrite [_ZWrite])Forces on "Write Properties as Static Values" if enabled.
Merges materials if they use different textures if their width, height & compression format match. Creates a Texture2DArray from the original textures.
Can't merge materials if:
#define CUSTOM_TEX2D(name) Texture2D nameIf disabled, the optimizer will not merge materials that have different textures assigned to the _MainTex property.
If you care about your avatar looking ok with disabled shaders you should disable this option.
This option tries to merge blend shapes that always get animated in the same ratio.
For example you have two animations. The first animates A to 100, B to 50 and C to 100. The second animates A to 50, B to 25 and D to 100. In this case the optimizer would merge A and B in a 2:1 ratio as they are always animated in that ratio.
Deletes all layers in the FX Layer that are considered useless:
暂无开放 Issues,或尚未同步最近议题。