Avatar Optimization Tips
Use Physical Bones
If you use DynamicBone for your avatar, please replace it with Physical Bones or Spring Animator.
Dynamic Bone is a Unity Asset that you can purchase. It allows you to define bones on the equipment of your avatar to make them move with the effect of dangling. You can also define static forces like gravity, which makes hair fall looks more naturally.
Dynamic Bone has been deprecated and will eventually be removed.
Limit the use of Cloth
Cloth is a default Unity component that has a similar runtime consumption to Dynamic Bones yet it is more difficult to set up. Currently, Cloth is not allowed on ParaSpace SDK. The Cloth component will be deleted automatically during uploading.
Reduce the number of meshes
You can use two types of MeshRenderer in Unity to render your character—Mesh Renderer and Skinned Mesh Renderer. For Mesh Renderer, mesh will not deform by bones or BlendShape. For Skinned Mesh Renderer, however, Rigs (bones) will be used to tell the engine how to move and deform the mesh based on the position of the bones. Such skinned meshes are much more expensive. We recommend that you set only one Skinned Mesh Renderer on your avatar.
Moreover, each additional mesh on your avatar generates one or more additional draw calls. This corresponds to the amount of time your processor and GPU spend drawing on the screen.
Therefore, we recommend that you use at most one Skinned Mesh Renderer and at most three Mesh Renderers. You can combine multiple Mesh Renderers or Skinned Mesh Renderers into one in your modeling software.
Reduce the number of mesh triangles
Make sure you don't use too many triangles. The SDK will warn you if you try to upload a mesh with triangles that exceed the upper limit (see [Avatar Asset Specification]). You rarely need too many polygon details. You can consider baking a normal map and simplifying your mesh by decimation or retopology.
Too many mesh triangles will cause poorer rendering performance of the avatar and affect the user experience of all players. We recommend minimizing the number of triangles in the model in the avatar modeling software.
You can reduce the number of triangles of meshes by merging multiple meshes and removing duplicate vertices.
Reduce the number of Mesh BlendShapes
You should minimize the number of BlendShapes and retain only the BlendShapes you want players to see at runtime. Too many BlendShapes will greatly reduce the rendering efficiency of the processor and GPU when there is lager number of triangles in the avatar model (> 30,000). Meanwhile, there will also be great pressure on network traffic and storage space.
Use less materials
If multiple materials are associated with the avatar, many draw calls will be generated at runtime, and each mesh component used in Unity will correspond to a separate material. We recommend that you combine meshes using the same materials into one mesh.
Use opaque materials
We recommend that you use opaque materials unless you are sure that transparent materials should be used. Transparent materials often require more GPU computing resources to draw. Using opaque materials will bring your avatar a better rendering effect. Opaque materials even have more pronounced optimizations on mobile and VR devices.
Set up the side of materials for culling
You can configure materials to set a component of the model to be visible on the front or back, or both. We recommend that you render one side of the component, as rendering both sides usually requires more GPU computing time.
Reduce the number of particles emitted
While particle systems can generate a lot of cool effects, excessive particle systems can cause problems on some computers. We recommend that you limit the number of particle systems applied and set an upper limit of particles emitted at any particular moment.
You can use some ways to ensure that a particle system has a large number of particles without compromising performance. For example, you can use dynamic batching of sprite particles; don't use collisions; and make sure your particles' motions are simple.
For more information about relevant technology, please refer to Unity's Profiler view to gauge how much CPU time your particle simulations require. In general, we recommend that you use many small and opaque particles rather than large transparent particles. Unity's particle system is optimized and runs fast if used appropriately.
Reduce the use of lighting
As lighting on the avatar is displayed in real-time, the cost to ensure performance is very high. Adding lighting effects to your avatar means that everything your light touches will be rendered with double draw calls. Extra lights will also double the rendering time.This is obviously detrimental to performance. Do not use lights that are always on. You can use an animated overlay to turn the flashlight on and off, or don't use lights at all.
If you use lights, disable the shadows. Shadows from real-time lights are very expensive and usually won’t look very good on moving objects.
Particle systems allow you to turn on lights on only some particles. Never do this! The lighting for every particle is regarded as a real-time light effect, which is (again) very expensive.
In general, we recommend you not use lights of any kind on your avatar. Not only do they adversely affect the performance of your own avatar, but they can also multiply the cost of attrition when the avatar is lit.
Updated over 1 year ago