源地址http://obi.virtualmethodstudio.com/tutorials/proxycharactercloth.html
Use Case: Character Clothing Using Proxies
Last update: Obi Cloth version 2.X
This example goes in detail about how to replicate the trenchcoat sample scene included in Obi Cloth 3.0.
用例:使用代理的角色服装
最后更新:Obi Cloth版本2.X
这个例子详细介绍了如何复制Obi Cloth 3.0中包含的风衣样例场景。

Using proxies you can efficiently simulate complex character clothing with multiple layers.
In this example, we will use the trenchcoat mesh included in Obi 3.x. You can use any mesh you want, but remember that it has to contain skinning information (in other words, it has to use a SkinnedMeshRenderer) and should have a clean topology (no non-manifold structures).
First of all, we will set up the trenchcoat as we would with any other skinned cloth: generate a ObiMeshTopology asset for the trenchcoat mesh, add an ObiCloth component to the SkinnedMeshRenderer, and initialize the cloth. You can read about all of this in detail here and here, as we won’t go into further detail abou the basic setup here.
Note that we haven´t mentioned the ObiSolver component yet. Obi 3.x allows you to choose the space in which the simulation will be performed: world space or local space. Now, if we were to simulate the trenchcoat in world space, things would work ok for the most part. This is the default behavior of ObiSolver. However, simulating cloth in local space has two advantages: we will suffer no numerical precision loss when we wander away from the world’s origin (which is essential for big game worlds), and the ability to control how much of the character movement is transferred to the cloth. So for character cloth, local space simulation is reccomended. In order to simulate actors in local space, we must set up the ObiSolver in a slightly different way:
First, all ObiActors using the solver must be below it in the scene hierarchy. So in case of a character, the solver must be placed at the root game object.
The solver should have “Simulate in local space” enabled.
In the included sample scene, you´ll notice the ObiSolver component has been added to the Man_trenchcoat object, and that “Simulate in local space” is checked. The trenchcoat object itself is a direct child of this object. You should mimic this setup as closely as possible when adding cloth to your own characters.
Now that we have the solver and the cloth in place, let’s start with the simulation. Enter particle edit mode, select all particles that should be simulated (in our case, all trenchcoat particles from the waist down) and unfix them. You should end with something like this:
使用代理可以有效地模拟具有多个层的复杂角色服装。
在本例中,我们将使用Obi 3.x中包含的风衣网格。
您可以使用任何您想要的网格,但是请记住它必须包含剥皮信息(换句话说,它必须使用SkinnedMeshRenderer),并且应该有一个干净的拓扑结构(没有非流形结构)。
首先,我们将像设置任何其他有皮肤的布料一样设置trenchcoat:为trenchcoat网格生成ObiMeshTopology资产,向SkinnedMeshRenderer添加obiccloth组件,并初始化布料。
您可以在这里和这里详细阅读所有这些内容,因为我们不会在这里详细介绍基本设置。
注意,我们还没有提到ObiSolver组件。
奥比3。
x允许您选择执行模拟的空间:世界空间或本地空间。
现在,如果我们要在世界空间中模拟战壕大衣,大部分情况下都可以。
这是ObiSolver的默认行为。
然而,在局部空间中模拟布有两个优点:当我们离开世界的原点时(这对于大型游戏世界是至关重要的),我们将不会遭受数值精度的损失,并且能够控制角色的运动有多少转移到布上。
针对字符布,提出了局部空间仿真方法。
为了在局部空间模拟参与者,我们必须以稍微不同的方式设置ObiSolver:
首先,所有使用求解器的ObiActors必须位于场景层次结构的它下面。
因此,对于角色,求解器必须放在根游戏对象中。
求解器应该启用“模拟本地空间”。
在包含的示例场景中,您将注意到ObiSolver组件已经添加到Man_trenchcoat对象中,并且选中了“在本地空间中模拟”。
trenchcoat对象本身是该对象的直接子对象。
在为自己的角色添加布料时,应该尽可能地模拟这种设置。
现在我们已经有了求解器和布料,让我们从模拟开始。
进入粒子编辑模式,选择所有应该被模拟的粒子(在我们的例子中,所有的风衣粒子从腰部以下)并解开它们。
你应该这样结尾:

Now, by clicking “Optimize” in the ObiCloth inspector (see the optimization page for more info) we can get rid of all particles that won´t actually be part of the simulation, to concentrate resources on the ones we need:
现在,通过点击obiccloth检查器中的“优化”(更多信息见优化页面),我们可以去除所有实际上不属于模拟的粒子,将资源集中在我们需要的粒子上:

Using tether constraints for a cloth this dense is almost mandatory if we want to prevent over-stretching (which can be a problem specially in fast-moving characters), so we hit “Generate tether constraints” in the cloth inspector. By doing this, Obi will automatically calculate the best tether configuration for our cloth. You can enable the “visualize” checkbox to get a visual preview of what the tether setup looks like for your mesh. In the case of our trenchcoat, all free particles have been automatically tethered to the waist in order to prevent stretching. If you want to know more about tethers, see this.
如果我们想要防止过度拉伸(这在快速移动的字符中可能是一个特别的问题),那么在布料检查器中使用系绳约束几乎是强制性的,所以我们点击“生成系绳约束”。通过这样做,Obi将自动计算我们的布的最佳系绳配置。您可以启用“可视化”复选框,以获得对网格的缆索设置的可视化预览。以我们的风衣为例,所有的自由粒子都被自动地系在腰部,以防止拉伸。如果你想了解更多关于绳子的知识,请看这个。

Up to this point, there’s been not many differences in our workflow when compared to a simple, single layered cloth. However, if we were to simulate the trenchcoat at this point, we’d see lots of artifacts and self-intersections because the mesh has two-sides that cannot collide with each other. Also, it has pockets, zones of different thickness… it would be insanely slow (and not very reliable) to try and simulate all of this using self-collisions.
For this reason, we will use cloth proxies. The same mesh can act both as proxy source and target, and that’s exactly what we´ll do here. Add a ObiClothProxy component to the trenchcoat, and you´ll see it only has two parameters: the source particle proxy (drag the trenchcoat itself here) and the skin map used to transfer the source simulation to the target mesh.
到目前为止,与简单的单层布料相比,我们的工作流程并没有太多的不同。然而,如果我们在这一点上模拟战壕大衣,我们会看到许多人工制品和自交点,因为网格有两面,不能互相碰撞。此外,它有口袋,不同厚度的区域…尝试使用自碰撞来模拟所有这一切将是极其缓慢的(而且不是非常可靠的)。
因此,我们将使用布代理。相同的网格可以同时作为代理源和目标,这正是我们在这里要做的。将ObiClothProxy组件添加到沟槽中,您将看到它只有两个参数:源粒子代理(将沟槽本身拖动到这里)和用于将源模拟转移到目标网格的皮肤映射。
It’s time now to author the skin map, which we will use to tell Obi which parts of the trenchcoat should be simulated, and which parts should simply follow the movement of the simulated part. In case of a trenchcoat, it is simpler to simulate the inner side of it, and skin the outside of the mesh -which has complex details- to it. Right-click on one of your project folders, and go to Create->Obi->Obi Triangle Skin Map. This will create a new skin map asset in your folder, rename it if you wish and check out its inspector:
现在是创建皮肤地图的时候了,我们将使用它来告诉Obi应该模拟战壕大衣的哪些部分,以及哪些部分应该简单地跟随模拟部分的运动。
在风衣的情况下,它是比较简单的模拟内部的一面,并皮肤的外部网格-这有复杂的细节-到它。
右键单击一个项目文件夹,然后转到创建->Obi->Obi三角形皮肤映射。
这将在你的文件夹中创建一个新的皮肤映射资产,如果你愿意重命名它,并检查它的检查器:

Set the source topology to be the one you generated the cloth with, and the target mesh to be the mesh you want to drive. In our case, we´ll use the trenchcoat topology and the trenchcoat mesh, since it will be both source and target. Now click “Edit Skin Map” to enter skin map editor:
将源拓扑设置为生成布料的拓扑,目标网格设置为要驱动的网格。
在我们的示例中,我们将使用trenchcoat拓扑和trenchcoat网格,因为它既是源也是目标。
现在点击“编辑皮肤地图”进入皮肤地图编辑器:

Once in the editor, we need to tell Obi which parts of the source mesh are going to drive the target mesh, and which parts of the target mesh should be driven. This is done using skin channels. Vertices in the target mesh will only be skinned to triangles in the source mesh that share at least one skin channel with them. In the case of the trenchcoat, there’s a cut at the back of it. Vertices at one side of the cut could accidentally be skinned to triangles on the other side, but we don´t want this to happen. The solution is to paint 2 skin channels: one for the left part of the trenchcoat, and another for the right part. This way, vertices won´t be able to latch to triangles on the other side of the cut.
进入编辑器后,我们需要告诉Obi源网格的哪些部分将驱动目标网格,以及应该驱动目标网格的哪些部分。这是通过皮肤通道完成的。目标网格中的顶点将只被蒙皮到源网格中的三角形中,这些三角形与它们共享至少一个蒙皮通道。就风衣来说,后面有个口子。切割的一边的顶点可能会被意外地剥成另一边的三角形,但我们不希望这种情况发生。解决方案是绘制2个皮肤通道:一个在风衣的左边,另一个在右边。这样,顶点就不能与切边另一边的三角形连接。

Skin channels 0 and 1 for the source mesh (seen from below, as they are inside the trenchcoat)

Skin channels 0 and 1 for the target mesh.
Once we are done painting our source/target skin channels, we can hit “Bind” and Obi will calculate and store the skin map for us. Now we are ready to use it, hit “Done” to close the editor and go back to the trenchcoat’s ObiClothProxy component and feed the skin map to it. That’s all!
To wrap up, this is everything we did:
Create and setup an ObiCloth component for the trenchcoat, as usual.
Add an ObiSolver component to the character root, and enable local space simulation. Note the trenchcoat is a child of the solver.
Create a ObiTriangleSkinMap and use skin channels to define driving/driven parts of the mesh.
皮肤通道0和1为目标网格。一旦我们完成绘制我们的源/目标皮肤通道,我们可以点击“绑定”,Obi将为我们计算和存储皮肤地图。现在我们可以使用它了,点击“完成”关闭编辑器,回到trenchcoat的ObiClothProxy组件,并将皮肤映射提供给它。这是所有!最后,这就是我们所做的一切:像往常一样,为战壕大衣创建并设置一个obiccloth组件。向字符根添加一个ObiSolver组件,并启用本地空间模拟。注意trenchcoat是solver的子元素。创建一个ObiTriangleSkinMap并使用

搬运+机翻 Unity插件 OBICloth插件官方CharDemo分析相关推荐

  1. Xunity.autotranslator机翻unity引擎的游戏

    提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言 一.Xunity.autotranslator是什么? 二.使用步骤 1.下载 2.运行程序 3运行游戏 总结 前言 ...

  2. Unity 大气特效插件分析 - Aura #01

    老实说我也不知道该叫啥了这标题wwww Aura是一个Unity的开源插件,可以实现较为出色的大气效果(如:体积光,体积雾等等): 传送门: Asset store: https://assetsto ...

  3. vscode 插件显示缩进_能让你开发效率翻倍的 VSCode 插件配置(中)

    这篇文章是<能让你开发效率翻倍的 VSCode 插件配置(上)>的续篇,包括 VSCode 外观增强.功能增强.编码效率等方面的 10 个插件,其中有部分插件也是我发布上篇文章之后在评论里 ...

  4. Unity游戏Mod/插件制作教程03 - 插件实例1: HelloWorld

    准备工作 作为编程类的教程,果然第一个需要来一个传统项目--HelloWolrd. 在开始之前,我先贴一个链接,这是BepInex官方的开发手册 https://bepinex.github.io/b ...

  5. 好看的翻页切换效果插件-BOOKLET

    http://www.sd131.com/jquery-info43 Booklet 为我们提供了一种漂亮的切换两个div的翻页效果. 插件信息 官网:http://builtbywill.com/c ...

  6. Unity的NGUI插件篇——入场效果

    Unity的NGUI插件篇--入场效果 入场效果 入场效果需要借助于NGUI提供的TweenPosition类来完成,为了说明此类的使用方法,本节将使会讲解两个示例.本文选自  大学霸 <NGU ...

  7. Unity时钟定时器插件

    Unity时钟定时器插件 http://dsqiu.iteye.com/blog/2020603 https://github.com/joserocha3/KillerCircles/blob/67 ...

  8. docker build run 卡住_还在使用第三方Docker插件?SpringBoot官方插件真香!

    SpringBoot实战电商项目mall(40k+star)地址:github.com/macrozheng/- 摘要 为了方便为SpringBoot应用构建Docker镜像,我们经常会使用Maven ...

  9. Unity好用插件集合1

    插件集合 3D Character Pack 4 characters LuciSoft 3D Low Poly Car For Games 14 Arrow Animations 1.0 A Pat ...

最新文章

  1. Linux命令大全(个人整理,如不全面望谅解)
  2. python diango_Django 安装
  3. IBASE write buffer
  4. Android Activity之间传递类对象
  5. 【2017年第4期】大数据平台的基础能力和性能测试
  6. 将深度缓冲z值变换到相机坐标系
  7. 你的数仓函数结果不稳定,可能是属性指定错了
  8. 宕机日志怎么看 thread detail_如何快速过滤出一次请求的所有日志?
  9. Jupyter notebook增加新的kernel
  10. Can‘t find third_party/gtest. Run git submodule update --init, or disable with CMake -DBUILD_TEST
  11. 记一次wireshark抓取QQ好友IP和火绒抓取微信IP
  12. Peer-To-Peer 综述(P2P技术综述)
  13. 为什么倡导企业使用电子招投标?
  14. 武汉大学计算机科学与技术培养方案,武汉大学计算机学院培养方案(2018版)
  15. 画计算机乐谱,邓紫棋《画》简谱
  16. PTA 3+2转段 数据库 mysql (3篇)
  17. [xdm+ip]ubuntu下载数据慢或者不通
  18. 机械设计中的BOM表
  19. 基于Go语言星座查询~
  20. 曼谷周末游(r5笔记第74天)

热门文章

  1. mtv和mcv开发模式
  2. Huawei RH2288 V3 风扇噪音大的解决方案
  3. 基于STM32-F401的平衡小车
  4. android 逆向so,逆向Android SO,以《遇见》App为例
  5. c++中x的y次方怎么求
  6. python设计一个三维向量类_一个简单的三维向量类
  7. java web架构配置_javaweb(1) tomcat配置和web程序结构
  8. python鼠标点击事件event_opencv-python教程学习系列5-处理鼠标事件
  9. 乐山计算机学校学籍管理,乐山计算机学校学生管理系统设计与实现
  10. 什么是端口映射?本文详尽解析!