标题: 中英文对照Unity3D脚本参考手册:蒙皮的网格渲染器 [打印本页] 作者: . 时间: 2012-10-16 08:52 标题: 中英文对照Unity3D脚本参考手册:蒙皮的网格渲染器 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 属性
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 布娃娃系统启用了蒙皮的网格
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):
•using vertex shaders which can push vertices out of precalculated bounds;
使用顶点着色器可以把预先计算的边界顶点;
•using ragdolls.
使用布娃娃。
In those cases there are two solutions:
在这种情况下,有两种解决方法:
1.modify Bounds to match potential bounding volume of your mesh;
修改边界匹配有可能的包围盒网格;
2.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.