Unity3D高级手册0601:优化的(Optimized)角色建模

2014-09-01 21:24:03|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:游戏, 虚拟现实, Unity3D|来源:唯设编程网

Unity Manual > Advanced > Optimizing Graphics Performance > Modeling Optimized Characters

Unity手册->高级->优化图形性能->模型优化角色

Use one Skinned Mesh Renderer 使用一个皮肤网格渲染器

Your character should use only a single Skinned Mesh Renderer. There is usually no reason to use multiple meshes for a character. Unity also has optimizations related to visibility culling and bounding volume updating which only kick in if you use one animation component and one skinned mesh renderer in conjunction. If you care about performance, multiple skinned meshes per character is not an option. If you use two skinned mesh renderers for one character instead of one, the time spent on rendering the character will most likely double!

你的角色应该只使用一个单一的皮肤网格渲染。通常没有理由使用一个多网格为一个角色。Unity也有与精选可见和卷更新结合的优化,仅交付如果你使用一个动画组件和一个皮肤网格渲染器在组合里。如果你关心性能,每个角色的多种网格皮肤不是一种选择。如果你为一个角色使用两个网格渲染器替代一个,在渲染角色上花费的时间将是双倍!

Don't use many Materials 不要使用许多材质

You also want to keep the number of Materials on that Mesh as low as possible. There is only one reason why you might want to have more than one material on the character: when you need to use a different shader (e.g. if you want to use a special shader for the eyes). However 2-3 Materials per character should be sufficient in almost all cases. If your character is carrying a gun, it might be useful to have the gun a separate object, simply because it might get detached.

你也希望能够保持尽可能低的网格材料的数量。只有一个原因,你可能想有一个以上的材料的在角色上:当你需要使用不同的阴影(例如,如果你要使用一个特殊的眼睛着色)。但是每个角色的2-3材料应足以满足几乎所有情况。如果你的角色是带着枪,可能通常用于枪的一个单独的对象,只是因为它可能会脱落。

Reduce amount of bones 减少骨骼的数量

Medium games use bone hierarchies with 15-60 bones. The fewer bones you use the faster it will run and with 30 bones you can do fairly good quality. Unless you really have to, we strongly recommend you use around 30 bones per character.

中等游戏使用15-60骨层次结构。你使用的少量的骨它将运行的快而利用30个骨你可以做到较好的质量。除非你真的要,我们强烈建议你大约30个角色骨头的使用。

Polygon count 多边形计数

How many polygons you should use depends on the quality you are going after. Anything between 500-6000 triangles is reasonable. If you want lots of characters on screen, you will have to sacrifice in polycount per character, if you want it to run on old machines, you will have to use less polygons per character. As an example: Half Life 2 characters used 2500-5000 triangles per character. Next-gen AAA games running on PS3 or Xbox 360 usually have characters with 5000-7000 triangles.

你应该使用多少多边形取决于你是追求的质量。任何事情在500-6000之间的三角形是合理的。如果你想在屏幕上很多角色,你将不得不牺牲每个角色的策略数,如果你想让它老机器上运行,你将不得不每个角色使用少多边形。作为一个例子:半条命2个角色每个角色使用2500-5000三角形。下一代AAA级游戏运行在PS3或Xbox 360上通常有5000-7000三角形的角色。

Separate out IK and FK 隔开IK和FK

Separate out Inverse Kinematics (IK) and Forward Kinematics (FK). When animations are imported the IK nodes are baked into FK, thus Unity doesn't need the IK nodes at all. You can either kill the GameObjects in Unity or the nodes in the modelling tool. By removing them, the IK nodes don't need to be animated every frame anymore. For this reason it is a very bad idea to intermix IK and FK hierarchies. Instead you should create two hierarchies: one strictly for IK and one for FK. This way you can very easily select the whole IK hierarchy and delete it.

隔离出逆向运动(IK)和正向运动(FK)。当动画导入的节点被烘烤到FK里,然而unity根本不需要IK节点。你也可以删除在Unity里的GameObjects或在建模工具里的节点。通过删除它们,IK节点不需要每帧的动画了。为此,它是一个非常糟糕的主意混杂IK和FK层次结构。相反,你应该创建两个层次:一是绝对的IK层和一个绝对的FK层。这种方式可以很容易地选择整个IK层并将其删除。

Use reusable rigs 重复利用装备

Create a rig which you can reuse. This allows you to share animations between different characters.

创建一个你可以重复使用装备。这允许你可以共享动画不同的角色。

Name bones correctly 正确命名骨骼

Name bones correctly (left hip, left ankle, left foot etc.). Especially with characters, naming your bones correctly is very important. For example if you want to turn a character into a Ragdoll you will have to find the right bones for each body part. If they are not named correctly, finding all the body parts will take much longer.

正确命名骨骼(左臀部,左脚脚踝,左脚等)。特别是与人物,正确地命名你的骨骼是非常重要的。例如,如果你想一个角色变成一个布娃娃你必须找到每个部位的正确骨骼。如果它们不正确命名,发现身体的所有部位将需要更长的时间。

发表评论0条 】
网友评论(共?条评论)..
Unity3D高级手册0601:优化的(Optimized)角色建模