Skinned Mesh Renderer
The Skinned Mesh Renderer is automatically added to imported meshes when the imported mesh is skinned.
An animated character rendered using the Skinned Mesh Renderer
Properties
Cast Shadows (Pro only) | If enabled, this Mesh will create shadows when a shadow-creating Light shines on it |
Receive Shadows (Pro only) | If enabled, this Mesh will display any shadows being cast upon it |
Materials | A list of Materials to render model with. |
Update When Offscreen | If enabled, the Skinned Mesh will be updated when offscreen. If disabled, this also disables updating animations. |
Quality | The maximum amount of bones affecting every vertex. |
Skin Normals | If enabled, geometry normals will be updated with the bone animation. |
Animation | The current animation (which can be changed via scripting). |
Details
Skinned Meshes are used for rendering characters. Characters are animated using bones, and every bone affects a part of the mesh. Multiple bones can affect the same vertex and are weighted. The main advantage to using boned characters in Unity is you can enable the bones to be affected by physics, making your characters into ragdolls. You can enable/disable bones via scripting, so your character instantly goes ragdoll when it is hit by an explosion.
A Skinned Mesh enabled as a Ragdoll
Skin Normals
When Skin Normals is enabled, normals will be correctly animated with the bones. This makes your character correctly react to lights. If it is disabled the normals from the character in bind pose will be used.
Skinning Normals comes at a slight performance cost. In some situations correct lighting is not necessary and you can get away with disabling this option. Play with it and see if it makes difference in your particular situation. If you can't see a difference, disable Skin Normals.
Quality
Unity can skin every vertex with either 1, 2, or 4 bones. 4 bone weights look nicest and are most expensive. 2 Bone weights is a good compromise and can be commonly used in games.
If Quality is set to Automatic, the Quality Settings Blend Weights value will be used. This allows end-users to choose a quality setting that gives them optimum performance.
Update When Offscreen
By default, skinned meshes that are not visible are not updated. The skinning is not updated until the mesh comes back on screen. This is an important performance optimization - it allows you to have a lot of characters running around not taking up any processing power when they are not visible.
However, visibility is determined from the Mesh's bounding volume, which is calculated from skinning. Sometimes, the bounding volume will change a lot based on the animation. In those few cases you need to enable Update When Offscreen to prevent object from suddenly appearing on screen.
For characters you should always check this option off in order to gain performance. This optimization will calculate a bounding volume relative to the transform on the first frame and then only move the bounding volume along with the transform but never update it based on the bones of the character.
There are some cases where you might want to turn off this optimization
- A large character that changes shape. Eg. a moving crane, where the bounding volume can change a lot.
- When the SkinnedMeshRenderer is not a child of the root bone. Eg. if you have a ragdoll and your skinned mesh renderer is not assigned to the root bone.
In order to make SkinnedMeshes work better with Ragdolls Unity will automatically remap the SkinnedMeshRenderer to the rootbone on import. However Unity only does this if there is a single SkinnedMeshRenderer in the model file. So if you can't attach all SkinnedMeshRenderers to the root bone or a child and you use ragdolls, you should turn off this optimization.
Hints
- Skinned Meshes currently can be imported from:
- Maya
- Cinema4D
- 3D Studio Max
- Blender
- Cheetah 3D
- XSI
- Any other tool that supports the FBX format