메쉬 렌더러
텍스트 메쉬

Skinned Mesh Renderer

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.

품질(Quality)

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.

QualityAutomatic에 설정된 경우, Quality SettingsBlend 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:

  • 런타임시에 애니메이션을 추가한 경우
  • Additive(추가) 애니메이션을 사용한 경우
  • 본의 위치를 프로시저에 영향을 미친 경우
  • 정점 쉐이더를 사용하여, 미리 계산된 경계 밖으로 정점을 밀어낸 경우
  • Ragdoll을 사용한 경우.

이 예에서는 두 가지 해결 방법이 있습니다 :

  1. Bounds(경계)을 수정하여 메쉬의 잠재적인 경계의 크기에 일치하도록 수정합니다.
  2. Update When Offscreen 스킨 및 렌더링된 스킨 메쉬에 대해 항상 활성화합니다.

대부분의 경우, 퍼포먼스에 미치는 영향이 적기 때문에 첫 번째 방법을 선택하게 됩니다. 두 번째 방법은 퍼포먼스을 중시할 필요가 없고, 경계의 크기를 예측하기 어려운 경우에만 사용하십시오. (예를 들면 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.

스킨 메쉬의 임포트

현재 다음으로 부터 스킨 메쉬가 임포트 될수 있습니다 :

  • Maya
  • Cinema4D
  • 3D Studio Max
  • Blender
  • Cheetah 3D
  • XSI
  • 다른 FBX 포맷을 지원하는 도구

모바일에서는 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.sharedMesh:

  1. In ‘non-optimized’ mode, you need to make sure that, the SkinnedMeshRenderer.bones match SkinnedMeshRenderer.sharedMesh in a strict way: the referenced Transforms should be there in the correct order.
  2. In ‘optimized’ mode, it’s much simpler. As long as the avatar has the referenced bones, the rendering will be fine. In this case SkinnedMeshRenderer.bones is always empty.
메쉬 렌더러
텍스트 메쉬