Unity uses the Skinned Mesh Renderer component to render Bone animations, where the shape of the mesh is deformed by predefined animation sequences. This technique is useful for characters and other objects whose joints bend (as opposed to a machine where joints are more like hinges).
Skinned Mesh Renderer(스킨 메쉬 렌더러)는 메쉬가 스키닝되는 경우, 임포트시 자동 추가됩니다.
|Cast Shadows||활성화하면, Mesh는 그림자를 생성하는 Light가 비추고 있었던 때에 그림자를 생성합니다.|
|Receive Shadows||If enabled, the Mesh will show shadows that are cast upon it by other objects.|
|Materials||The list of Materials the model will be rendered with.|
|Use Light Probes||Does the mesh take Light Probes into account?|
|###품질(Quality)||The maximum number of bones that can affect any given vertex.|
|###오프 스크린 업데이트||If enabled, the Skinned Mesh will be updated even when it can’t be seen by any camera. If disabled, the animations themselves will also stop running when the object is offscreen.|
|Mesh||렌더러에 따라 사용되는 메쉬.|
|Root Bone||The bone that is the “root” of the animation (ie, the bone relative to which all the others move).|
|Bounds||The bounding volume that is used to determine when the mesh is offscreen. The bounds are precalculated on import from the Mesh and animations in the model file and are displayed as a wireframe around the model in the Scene View.|
Bones are invisible objects inside a skinned mesh that affect the way the mesh is deformed during animation. The basic idea is that the bones are joined together to form a hierarchical “skeleton” and the animation is defined by rotating the joints of the skeleton to make it move. Each bone is attached to some of the vertices of the surrounding mesh. When the animation is played, the vertices move with the bone(s) they are connected to, so the “skin” follows the movement of the skeleton. At a simple joint (an elbow, say), the mesh vertices are affected by both of the bones that meet there, and the mesh will stretch and rotate realistically as the joint bends. In more complex situations, more than two bones will affect a particular area of mesh, resulting in more subtle movements.
Although a skinned mesh is most commonly used with predefined animations, it is also possible to attach Rigidbodies to each bone in a skeleton to put it under the control of the physics engine. This is typically used to create the “ragdoll” effect, where a character’s limbs flail after being thrown or struck by an explosion.
Unity can skin every vertex with one, two or four bones. Using four bones gives the best results but this comes with a higher processing overhead. Games commonly use two bone weights, which is a good compromise between visual quality and performance.
Quality가 Automatic에 설정된 경우, Quality Settings의 Blend Weights가 사용됩니다. 따라서 최종 사용자가 최적의 성능 품질 설정을 선택할 수 있습니다.
By default, skinned meshes that are not visible to any camera are not updated, since this avoids wasting CPU time. The skinning is not updated until the mesh comes back on screen.
The object’s visibility is determined from the Mesh’s Bounds (ie, the entire bounding volume must be outside the view frustum of any active camera). However, the true bounding volume of an animated mesh can change as the animation plays (eg, the volume will get taller if the character raises their hand in the air). Unity takes into account all attached animations when calculating the maximum bounding volume but there are cases when the bounds can’t be calculated to anticipate every possible use case. Each of following situations, for example, become a problem when they push bones or vertices out of the precalculated bounding volume:
이 예에서는 두 가지 해결 방법이 있습니다 :
대부분의 경우, 퍼포먼스에 미치는 영향이 적기 때문에 첫 번째 방법을 선택하게 됩니다. 두 번째 방법은 퍼포먼스을 중시할 필요가 없고, 경계의 크기를 예측하기 어려운 경우에만 사용하십시오. (예를 들면 Ragdoll의 경우)
In order to make Skinned Meshes work better with ragdolls, Unity will automatically remap the Skinned Mesh Renderer to the root bone on import. However Unity only does this if there is a single Skinned Mesh Renderer in the model file. This means that if there is some reason why you can’t attach all Skinned Mesh Renderers to the root bone or a child and you use ragdolls, you should turn off this optimization.
현재 다음으로 부터 스킨 메쉬가 임포트 될수 있습니다 :
모바일에서는 hand-coded 된 NEON/VFP 명령어로 CPU가 스키닝을 합니다. 주의 : 법선과 탄젠트는 normalized 되지 않기 때문에, 스스로 작성한 쉐이더라면 직접 normalization 해주십시오. 만약, 표면 쉐이더를 사용한다면 normalization은 자동으로 생성됩니다.
Note. Optimized meshes sort bones differently from non-Optimized meshes, resulting in potentially significant animation problems. This is because non-Optimized meshes rely on bone order to animate, while Optimized meshes use the bone names and are order-independent.
If you simply import the FBX file and use it, Unity will take care of the order of the transforms.
BUT for advanced users, if you want to change
SkinnedMeshRenderer.sharedMeshin a strict way: the referenced Transforms should be there in the correct order.
SkinnedMeshRenderer.bonesis always empty.