個人檔案Quake3 启示录相片部落格清單更多 工具 說明

部落格


7月11日

Gamebryo/Artist's Guides/Gamebryo 3ds max Plug in/Geometry and Performance(II)

Grouping and 3ds Max
群组和3ds Max

As with Multi/Sub-Object materials, grouping should be used with care. Everything in a scene in Max has a corresponding node in its scene graph. In Gamebryo, that node is called an NiNode. An NiMesh represents a group of triangles while an NiNode contains a list of children and a list of transforms. Whenever a collection of objects in Max is grouped, the Gamebryo 3ds max plug-in has to add another NiNode to group them together in Gamebryo.

Indiscriminate use of grouping can have a significant effect on the triangle/mesh ratio. In general, a high-triangle single object has much better frame-rate performance then many objects grouped together.

同使用Multi/Sub-Object材质一样,群组应该小心使用。在Max场景中的每个东西都有一个对应的节点在它的场景图中。在Gamebryo中,这个节点称为NiNode。一个NiMesh描述了一组三角形而一个 NiNode 包含了一个子结点列表以及一个变换列表。无论何时物体的集合在Max中被群组化,Gamebryo 3ds max插件必须加入另一个NiNode 将它们在Gamebryo中组合起来。

不加选择的应用群组会对triangle/mesh ratio比率产生重大的影响。总的来说,一个复杂三角形单一对象比许多对象群组在一起,在帧速率上可以获得更好的性能。

Skinning & Morphing with 3ds Max

Skinning for Artists

There are a few important bits of hardware knowledge that a character animator and modeler should be aware of before jumping into skinning a character. The hardware skinning pipeline is broken into two important numbers, the maximum number of bones the hardware can handle and the maximum number of bones that can influence a vertex. Each number has an important role to play in determining how your skinned character will perform in a game.

The maximum number of bones the hardware can handle by default for most platforms is four. What exactly does this mean? Four is a really small number for a character. Behind the scenes, Gamebryo will break the skinned mesh apart into pieces that obey this limit. These pieces are referred to as skin partitions. For each partition we generate, we have to render the partition's geometry in a separate rendering call. For instance, a skinned character with 28 bones could be broken into 23 partitions in order to obey the maximum bone limit. This means that we are rendering the model in 23 separate pieces. Furthermore, each partition can only be composed of the vertices that use only those bones. If you're not careful in your weight assignments, you could end up with a partition with only one triangle!

The maximum number of bones influencing a vertex by default on most platforms is also four. This means that a vertex that is influenced by five or more bones will only use the four most influential bones in its skinning. This may result in cracks in sections where many bones come together like the back of the neck and the crotch. Careful modeling and weight assignment will help to minimize this problem. This does not mean that you should always use four bones per vertex. In fact, it is best to use as few weights as are visually acceptable per vertex. This will help substantially when partitioning the mesh because more vertices will be able to fit into a partition.

What should you take away from this discussion? First off, how you skin your character will directly transfer into performance for that character. Listed below are some useful hints on how to analyze your skinning performance and tips for getting good performance in general.

  • Do not use N-Links when skinning with Physique. Stick with No Blending or 2-Links.

  • Use the SkinAnalyzer plug-in to see how exactly your skin was broken apart into partitions.

  • Use the Skin Weight Threshold export option to drop weights that are trivial. This will greatly improve performance. Be careful to make sure that odd skinning artifacts do not result when this value is raised.

  • Use a pixel/vertex shader for skinning. This can really boost your performance if you can accept the fact that the shader will not work on cards that are not compliant with the version of pixel and vertex shader used. Often you can reduce the partition count to one or two using shaders.

Physique vs. Skin modifier

The Gamebryo Max Plug-in supports the two major modifiers for skinning. We have found the recent  versions of Skin to be more reliable and robust then Physique, even when applied to bipeds, however both are supported.

Gamebryo doesn't support floating bones for physique. If your model requires this capability, we suggest modeling with Skin instead of physique.  In the Physique Level-Of-Detail panel, we only support Rigid Skin Update. When using Deformable, the exporter treats it like Rigid.

Linking your skinned object

Do not attach a skin to a bone in the hierarchy below that to which the skin is bound. This causes the mesh to translate twice, once for the skin binding and another for the child translation. You can create a node above the Bip01or base node to which the skin is attached, or use a character node to organize a bone structure and skin together.

The mesh that has the Skin or Physique modifier uses the bones to determine its bounding volume. The hierarchy is updated by a depth-first traversal of the scene. If the skin occurs before the bones in a depth first traversal of the scene, the skin's bounding volume will lag one frame. Move the skin so that it occurs after the bone hierarchy in a depth first traversal to avoid this problem.

Scaling your skinned object

Do not scale a mesh after binding. If you scale a mesh you must unbind it first and rebind it after it has been properly scaled and translated. Scale it first and reset its transforms before you bind it to the bone system for best results.

Morph and Skin work together

Even though we support combining skin & morph targets we do not suggest it. If you want to make a character have facial animation morph targets, detach the head from the rest of the body and have it attached to the head bone as a direct link. The head mesh can use a morph target and translate via its relation with the head bone while the body uses a skin or physique modifier. When both modifiers are combined on a mesh it is much slower as all the vertices are being transformed twice, once in software and once in hardware. Please take this into consideration when making characters that have facial expression. See the section on Morphing Faces on Skinned Characters for more information.

Morph Targets

The Morph Modifier and Morph compound object are both supported in Gamebryo. We have found the Morph Modifier more reliable then the compound object in Max. Morph is inherently slower than skinning due to the fact that morphing is still done in software. However, there are many things that are easier to do with morph targets than with bone movement. Suggested uses for Morph targets are things like animated flags, facial expression and non-uniform scales.

Instancing with Skinning and Morphing

Objects that are skinned or morphed are exported such that clones (instances) are independently controlled and animated. However, when the Mesh Instancing tool plug-in is used, CPU skinned and morphed objects that are instances or exact copies in the Max scene will be exported as hardware instances. As a result, there is only one animated object and every other instance appears exactly the same. Move CPU skinned and morphed instances to another Max scene or use export selected to prevent this behavior when using the Mesh Instancing plug-in.

Reading Skin Analyizer Plug-in Output

The following section is a sample output from the skin analyzer plug-in.

image1

The model was broken into 23 partitions out of 28 bones. This model will likely perform moderately well. The key problems come around partition 19 in the list. Here we drop below 40 triangles per partition. At this point we are paying a fair amount of overhead for 6 partitions that don't have that many triangles in them. DirectX especially pays for this overhead. Often, this is unavoidable in modeling as some sections are the nexus of many bones and will be prone to small partitions (the neck and groin in particular). In general, the thing to be wary of is when the number of partitions exceeds the number of bones. This is horrible for performance because it also means that many of the partitions are incredibly small.

Listed below the main chunk of text is a breakdown of each partition. This lists the bones involved in that partition and what the average weights were for that bone. This text can often be useful in pinpointing problem vertices since the bones in that partition would influence them

Cloning and Instancing with 3ds Max

3ds Max中的克隆和实例

Instanced objects in Max are shared in Gamebryo as well. This technique can be extremely useful on memory-starved consoles. Note: If you adjust the pivot or non-uniform scale of an instance, it will become unique. Uniform scale is supported, but non-uniform scale cannot work with instances in Gamebryo because non-uniform scale is baked into the geometry. It should also be noted that instanced objects in Gamebryo must share the same material, unlike in Max. Instanced objects that need different materials should be made unique.

Max中实例对象可以在Gamebryo很好的共享。这项技术对于内存受限的主机非常的实用。注意:如果你调整轴心点或者不成比例缩放一个实例,它将变得唯一。均匀缩放是被支持的,然而,不能对Gamebryo中实例进行不均匀缩放,因为不均匀缩放会烘培几何体(使几何体发生不规则变形,max有烘培一个操作)。还要注意Gamebryo中的实例对象必须共享相同的材质,这点不同于Max。 需要不同材质的实例对象应该制作成唯一的,不共享的。

Non-Uniform & Uniform Scale

不均匀和均匀缩放

Gamebryo does not support animating non-uniform scales (i.e. scales with different values in the x, y, and z axes). Animating non-uniform scale is not supported and will be treated like a uniform scale when animating. All static non-uniform scales are baked into the geometry data itself.

If you need to have something non-uniformly scaled or squashed, use a morph target to achieve the action. Morph targets can be created by squashing an object in 3ds max and using Tools / Snapshot to grab a desired morph target.

Gamebryo不支持动画不均匀的缩放(比如在x,y和z轴上有不同的缩放比例) 。动画的不均匀缩放是不支持的并且在动画中做为等比例缩放的方式来处理。所有静态的不均匀缩放会烘培到几何数据本身。

如果你需要使某些东西非等比例的缩放或者挤压,应用变形动画修改器对象(morph target)来完成这个任务。变形对象(morph target)可以在3ds max中通过挤压来制作,并应用Tools/Snapshot来获取一个想要的变形体对象(morph target)。

Multi/Sub-Object and Triangle/Mesh Ratios

Multi/Sub-对象 和 Triangle/Mesh 比率

A convenient way of texturing an object in Max is to use the Multi/Sub-Object material. However, Gamebryo only supports one material per mesh because most hardware can only handle one material per set of triangles. When the Gamebryo 3ds max Plug-in encounters a Multi/Sub-Object material it must split the Max Mesh into multiple NiMesh objects (one for each material).

在Max中贴图一个对象便利的方法是应用Multi/Sub-Object 材质。然而,Gamebryo只支持每个网格一个材质,因为大部分硬件只能为一个三角形集合处理一个材质。当 Gamebryo 3ds max 插件遇到一个Multi/Sub-Object材质,它必须将Max网格分开成多个NiMesh 对象 (每个网格对应一个材质)。

Over-use of Multi/Sub-Objects is the most common offender in terms of performance in most data sets support receives.
技术支持收到的大部分性能相关的问题都是和过度使用Multi/Sub-Objects 相关的

If used indiscriminately, Multi/Sub-Object materials can lay waste to the triangle/mesh ratio and you end up with a single object made of many little pieces. Multi/Sub-Object materials do not need to be completely avoided but they should be used cautiously and with a consideration of the triangle/mesh ratio constraints.

如果不加选择的使用Multi/Sub-Object材质可能造成triangle/mesh 比率的浪费以及导致一个单独物体被分成很多片。也不是绝对要禁用Multi/Sub-Object材质,但是应该小心的应用并且考虑到triangle/mesh比值的限制。

When doing characters and discreet objects, the concept of a single texture 'Skin' for the subject is recommended.
当处理角色和离散物体时,推荐使用"皮肤",它代表一个单独纹理的概念。

An item made of 1 or 2 objects draws faster than one made of 12 or 13.  This is not to say, "Never use Multi-Subs" as they are very convenient. However, as an example we have received a support question on performance with a single character that had a multi-sub material on it. He was created in such a way that when exported, this single character turned into 42 different objects! This laid waste to performance since each of those 42 objects became individual meshes each with non-trivial overhead.

一个由一两项组成的对象比由12或13个项组成的画得快。这不是说即使便利也不使用Multi-Subs。对于拥有multi-sub材质的单一角色性能问题,我们收到过一个技术支持的例子。它在导出时以这样的方式进行,这个单一的角色被转换成了42个不同的对象! 这造成了性能浪费,因为这42个对象中每一个都是单独的网格以至于造成了不平凡的开销。

如果使用了它,Gamebryo exporter就会把一个Mesh分成多个导出。而每一个Mesh都需要一个Draw call来完成渲染。这就影响效率了。
举个例子,如果你要做一片草地,每棵小草就是一个Model的话,那么就有太多的geometry nodes。从而需要太多的Draw call来渲染。如果把一小片草地组成一个geometry node,Draw call就减少了。因为每一个Draw call都要相应地改变Render state,这就消耗了一定的时间。
结论应该是,不是不能用(因为有的时候用起来较为方便),而是慎用。用的时侯尽量考虑到对效率的影响。

对于directx draw call 调用次数也是有限制的。即使函数什么都不做。当然切换渲染状态相对较小。但如果不需要的渲染状态也会影响。如没有用到alpha blend ,但打开了alpha blend 渲染状态。

更多性能问题参考文档
http://topameng.spaces.live.com/blog/cns!F962D4854A8233D!352.entry

Multiple UVs, Smoothing Groups and Vertices

多重 UVs,平滑群组和顶点

Another geometric concern is Max's Mesh representation itself. Max can have more than one normal and UV (within a single UV channel) per vertex while real-time engines cannot. To resolve this incompatibility our 3ds max Plug-in will add additional vertices so that the NiMesh created has only one normal and UV per vertex. The NiMesh will look the same as the Max Mesh but will have more vertices. This vertex bloat will push the transform-rate but it is seldom a big problem. Using a lot of smoothing groups or complicated UV Mappings will make the problem worse but some vertex bloat is unavoidable.

Having things smooth is faster than having things flat shaded. Vertexbloat.max is also a good example of this phenomenon. A 120-triangle sphere with 1 smoothing group has 62 vertices and a flat or un-shaded version has 358 vertices.

另一个几何上的关注点是Max网格描述本身。Max每个顶点可以拥有超过一个的法线和UV (带一个单独的UV通道) 而实时的引擎却不可以。为解决这种不兼容性的3ds max 插件加入了额外的顶点,所以创建的NiMesh每个顶点只有唯一的法线及UV。NiMesh 看上去将和Max中网格一样但它拥有更多的顶点。这种顶点膨胀将给变换速率造成负担,但是它不是一个大问题。应用很多平滑群组或者复杂的UV Mappings将会加重这个问题,但是一些顶点的膨胀是无法避免的。

使物体原滑比使他们平坦着色更快些。 Vertexbloat.max也是这个现象的很好的例子。一个120三角面的球带一个平滑的群组拥有62个顶点而一个平坦或者无着色的版本有358个顶点。


image002

The test case Vertexbloat.Max demonstrates this effect.

Box01 has the usual Max UV mapping and a texture map that visualizes the UVs. In Max the vertex at the tip of the pink corner has the three UVs (1,0), (0,0) and (0,1).

The Gamebryo 3ds max Plug-in will generate three vertices to replace this one Max vertex —one for each UV.  While 3ds max represents Box01 as 12 triangles and 8 vertices, the Gamebryo 3ds max Plug-in will convert this model into 12 triangles and 24 vertices.

测试例子中 Vertexbloat.Max 演示了这种效果。

Box01拥有通常的贴图以及一个可视化UV的材质贴图。在Max中在粉色角落顶点上有3个UV(1,0), (0,0) 以及 (0,1)。

Gamebryo 3ds max 插件产生了3个顶点来代替这个Max中的顶点,每个UV对应一个。虽然3ds max将 Box01 描述成12个三角和8个顶点,但Gamebryo 3ds max 插件将这个模型转化成12个三角和24个顶点。

 

Mesh Profile Custom Attribute
网格档案Profile定制属性

Every piece of geometry has a Mesh Packing Profile associated with it. This is used by the Packer tool plug-in to create the platform-specific geometry streams used by the graphics card. Depending on the situation, it can be necessary for a specific mesh to override the scene default packing profile and use its own profile. To override the scene default packing profile one would click on the "Add/Remove Mesh Profile attribute" button to add a Mesh Profile Attribute to the selected mesh.
几何体的全部面片拥有一个 Mesh Packing Profile和它相关联。打包插件使用它来创建平台细节几何体流。基于这个情况,使用自定义的Profile覆盖特定网格上的scene default packing profile 是必须的。为了覆盖场景默认的包装profile可以点击 "Add/Remove Mesh Profile attribute"按钮来添加一个网格profile属性到选择的网格上。

MeshProfileSelection

For additional information on mesh profiles see Introduction to Mesh Profiles.
更多关于网格profiles的信息请参考Introduction to Mesh Profiles

Precache Custom Attributes
缓存定制属性

PrecacheCustAttribs The precache attributes serve a similar pupose to the Mesh Profile Custom Attribute. The mesh profile system provies all of the functionality of the precache attributes and more. The precache attribtues still exist in case a user wants precache control without having to author a custom profile as well as for backwards compatibility.

These custom attributes tell the Gamebryo renderers how to treat an object once they have created the platform-specific versions of it. Creating the platform-specific version is called "pre-caching" the object. In some cases it may be useful for applications to keep information lying around after it has been "pre-cached".

As an important example, triangle-triangle collision detection will not work if the triangles are thrown away once the renderer has pre-cached its data.

Typically, artists will not need to add these attributes, since any application that pre-caches geometry, can set the "Keep" flags to hold on to data that is needed, as well. The UI exists so that advanced users can have complete control over how specific art assets are used by the renderers.

These flags can be added through the user-interface via the Gamebryo toolbar. Click on the "Add/Remove Precache flags" icon.
缓存属性和Mesh Profile Custom Attribute章节目标相似。网格Profile系统提供了所有的预先缓存属性的功能,甚至更多。预先缓存属性存在目的是,用户想要缓存管理而不想创建一个定制的profile,同时也是为了向后兼容。

这些定制属性告诉Gamebryo渲染器,在创建平台细节的版本时如何对待对象。创建具体平台版本称为"pre-caching"对象。在某些情况下,应用程序在"pre-cached"之后,保持闲置信息是十分有用的。
一个重要的例子,如果渲染器在预存数据后扔掉了三角形数据,那么三角形对三角形的碰撞检测就不能工作。
一般而言,不需要美工来添加这些属性,因为预先缓存几何体的应用程序,可以设置"keep"标志来保持它需要的数据。这个UI保留着,以便让高级用户能够完全控制特定的美术资源如何被渲染器使用。

这些标志这些标志可以通过用户界面的 Gamebryo toolbar 加入。点击 "Add/Remove Precache flags" 图标。

Geometry Data Consistency
几何数据一致性

This radio button allows you to set how the renderer treats the data at runtime. "Default" sets the consistency to whatever Gamebryo best determines the data to be. "Static" means that once the data is in the renderer it will never change. This is a good setting for set pieces like buildings. "Mutable" means that the object may change from time to time. This would be useful for an application effect like changing a car's geometry to reflect hits it has taken on the road while driving. "Volatile" means that the object changes every frame. This setting is best set for when you are changing vertex colors on the fly or manually animating the UV coordinates.
这个单选按钮允许用户设定渲染器在实时状态下如何处理数据。"Default" 由Gamebryo 来决定数据的一致性。"static" 指一旦数据进入了渲染器将不再改变。这个选项是用于设定类似建筑物的部件的好选择。"Mutable"意味着对象可能偶尔发生变化。比如需要表现出一辆汽车在驾驶过程中因碰撞发生形状改变效果,这时这个选项对应用程序就十分有用了。"Volatile"意味着这个对象每一帧都要发生改变。当你正在改变顶点颜色或者手工动画绘制UV坐标时,这个选项就是最好的选择。

Data To Preserve
保留的数据

These check boxes allow the user to set which data is kept around after the "pre-cache" has occurred.

这些复选框允许用户设定哪些数据在 "pre-cache"后需要保留下来。

回應 (2)

請稍候...
很抱歉,您輸入的回應過長。請縮短您的回應。
您尚未輸入內容,請再試一次。
很抱歉,目前無法新增您的回應,請稍後再試。
若要新增回應,您的父母必須先給您權限。要求權限
您的家長已關閉回應功能。
很抱歉,目前無法刪除您的回應,請稍後再試。
您已超過每日回應上限次數,請於 24 小時後再試一次。
由於系統顯示您可能傳送垃圾郵件給其他使用者,因此您帳號中的回應功能已遭停用。 如果您認為自己帳號遭錯誤停用,請連絡 Windows Live 支援
請完成下列安全檢查,以完成回應。
您輸入的安全檢查字元必須與圖片或音訊中的字元相符。

若要新增回應,請以您的 Windows Live ID 登入 (若您使用 Hotmail、Messenger 或 Xbox LIVE,則您已擁有 Windows Live ID)。登入


沒有 Windows Live ID?註冊

hulu撰寫:
http://www.goodlaptopbattery.co.uk/dell/inspiron-1720.htm Dell inspiron 1720 battery
http://www.goodlaptopbattery.co.uk/dell/vostro-1500.htm Dell vostro 1500 battery
http://www.goodlaptopbattery.co.uk/dell/vostro-1700.htm Dell vostro 1700 battery
http://www.goodlaptopbattery.co.uk/dell/0xr693.htm Dell 0xr693 battery
http://www.goodlaptopbattery.co.uk/dell/312-0625.htm Dell 312-0625 battery
http://www.goodlaptopbattery.co.uk/dell/312-0633.htm Dell 312-0633 battery
http://www.goodlaptopbattery.co.uk/dell/gw240.htm Dell gw240 battery
http://www.goodlaptopbattery.co.uk/dell/hp297.htm Dell hp297 battery
http://www.goodlaptopbattery.co.uk/dell/rn873.htm Dell rn873 battery
http://www.goodlaptopbattery.co.uk/dell/xr693.htm Dell xr693 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-1525.htm Dell inspiron 1525 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-1526.htm Dell inspiron 1526 battery
http://www.goodlaptopbattery.co.uk/dell/m1210.htm Dell m1210 battery
http://www.goodlaptopbattery.co.uk/dell/nf343.htm Dell nf343 battery
http://www.goodlaptopbattery.co.uk/dell/1210.htm Dell 1210 battery
http://www.goodlaptopbattery.co.uk/dell/cg036.htm Dell cg036 battery
http://www.goodlaptopbattery.co.uk/dell/xps-m1210.htm Dell xps m1210 battery
http://www.goodlaptopbattery.co.uk/dell/d044h.htm Dell d044h battery
http://www.goodlaptopbattery.co.uk/dell/w953g.htm Dell w953g battery
http://www.goodlaptopbattery.co.uk/dell/312-0831.htm Dell 312-0831 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-910.htm Dell inspiron 910 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-mini-9.htm Dell inspiron mini 9 battery
http://www.goodlaptopbattery.co.uk/dell/xd187.htm Dell xd187 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-1300.htm Dell inspiron 1300 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-b120.htm Dell inspiron b120 battery
http://www.goodlaptopbattery.co.uk/dell/inspiron-b130.htm Dell inspiron b130 battery
http://www.goodlaptopbattery.co.uk/gateway/12msb.htm Gateway 12msb battery
http://www.goodlaptopbattery.co.uk/gateway/m360.htm Gateway m360 battery
http://www.goodlaptopbattery.co.uk/gateway/m680.htm Gateway m680 battery
http://www.goodlaptopbattery.co.uk/gateway/m460.htm Gateway m460 battery
http://www.goodlaptopbattery.co.uk/gateway/4s2p.htm Gateway 4s2p battery
http://www.goodlaptopbattery.co.uk/gateway/m680.htm Gateway m680 battery
http://www.goodlaptopbattery.co.uk/gateway/m460.htm Gateway m460 battery
http://www.goodlaptopbattery.co.uk/gateway/m360.htm Gateway m360 battery
http://www.goodlaptopbattery.co.uk/gateway/squ-412.htm Gateway squ-412 battery
http://www.goodlaptopbattery.co.uk/gateway/8msb.htm Gateway 8msb battery
http://www.goodlaptopbattery.co.uk/gateway/8msbg.htm Gateway 8msbg battery
http://www.goodlaptopbattery.co.uk/gateway/m360.htm Gateway m360 battery
http://www.goodlaptopbattery.co.uk/gateway/m680.htm Gateway m680 battery
http://www.goodlaptopbattery.co.uk/gateway/m460.htm Gateway m460 battery
http://www.goodlaptopbattery.co.uk/gateway/s62044l.htm Gateway s62044l battery
http://www.goodlaptopbattery.co.uk/gateway/m320.htm Gateway m320 battery
http://www.goodlaptopbattery.co.uk/gateway/m325.htm Gateway m325 battery
http://www.goodlaptopbattery.co.uk/gateway/4000.htm Gateway 4000 battery
http://www.goodlaptopbattery.co.uk/gateway/s62066l.htm Gateway s62066l battery
16 小時前
10 月 21 日

引用通告

此內容的引用通告是:
http://topameng.spaces.live.com/blog/cns!F962D4854A8233D!442.trak
引述這則內容的部落格