标题: 蒙皮的网格渲染器 [打印本页] 作者: 刀锋狼 时间: 2014-5-26 03:12 标题: 蒙皮的网格渲染器 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
如果启用,当创建光照阴影时Mesh将会创建阴影。
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.
渲染模型的材质列表。
Quality 质量
The maximum amount of bones affecting every vertex.
最大数量的影响着每一个顶点的骨骼。
Update When Offscreen
画面外更新
If enabled, the Skinned Mesh will be updated when offscreen. If disabled, this also disables updating animations.
如果启用时,将更新屏幕外骨骼蒙皮。如果禁用,这也将禁用更新动画。
Bounds 范围
These bounds are use for determining when skinned mesh is offscreen. Bounding box is also displayed in the SceneView. Bounds are precalculated on import based on Mesh and animations in the model file.
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.
蒙皮网格用于渲染人物。人物动画使用的骨骼,而且每个骨骼影响网格的一部分。多个骨骼的影响相同的顶点和的权重。使用Unity骨骼人物的主要优势是可以使骨骼受到物理影响,制作你的角色布娃娃。您可以启用/禁用通过脚本的骨骼,所以你的角色立即开始布娃娃当它击中爆炸时。
A Skinned Mesh enabled as a Ragdoll 布娃娃系统启用了蒙皮的网格
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.
Unity可以用1,2,或4骨骼顶点蒙皮。4骨骼权重看起来很好并且是很费资源的。2骨骼权重是一个很恰当的并且在游戏中经常用。
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.
如果Quality设置为自动,质量设置混合权中值将被使用。这允许最终用户选择质量设置,使他们获得最佳性能。
Update When Offscreen and Bounds 画外和范围的更新
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***nning around not taking up any processing power when they are not visible.
默认情况下,蒙皮网格不可见网格并不会更新。直到网格返回屏幕上时,蒙皮才会更新。这是一个重要性能优化 - 这可以让你周围有很多角色,当它们不可见时,运行时并不会采取任何处理。
However, visibility is determined from the Mesh's Bounds, which is precalculated on import. Unity takes into account all attached animations for precalcualating bounding volume, but there are cases when Unity can't precalculate Bounds to fit all user's needs, for example (each of these become a problem when they push bones or vertices out of precalculated bounding volume):
然而,能见度是取决于网格的边界,这是在导入上预先计算的。Unity考虑所有附加动画预先计算的边界量,但在某些情况下Unity可以不预先计算界限,以符合所有用户的需求,例如(其中每个成为一个问题,当他们把骨骼或顶点预先计算包围盒):
adding animations at***n-time;
在运行时添加动画;
using additive animations;
使用附加的动画;
proceduraly affecting positions of bones;
程序影响骨骼位置;
using vertex shaders which can push vertices out of precalculated bounds;
使用顶点着色器可以把预先计算的边界顶点;
using ragdolls.
使用布娃娃。
In those cases there are two solutions:
在这种情况下,有两种解决方法:
modify Bounds to match potential bounding volume of your mesh;
修改边界匹配有可能的包围盒网格;
enable Update When Offscreen to skin and render skinned mesh all the time.
使一直更新屏幕外的蒙皮和和渲染蒙皮网格。
You should use fist option most of the time since it has better performance and use second option only if performance is not important in your case or you can't predict the size of your bounding volume (for example when using ragdolls).
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.