__网格__构成了 3D 世界的很大一部分。Unity 提供了一个称为 ProBuilder 的建模工具,另外还有一些 Asset Store 建模插件,例如 Mesh Deformer、UModeler 和 Mesh Editor。而且 Unity 与大多数 3D 建模软件之间有很好的交互性。
Unity 支持三角或四边的多边形网格,因此必须将 Nurbs、Nurms 和 Subdiv 表面转换为多边形。
Unity 使用两种主要类型的碰撞体:网格碰撞体和原始碰撞体。网格碰撞体是使用导入网格数据的组件,可由 Unity 用于环境碰撞。在 Model 选项卡上启用 Generate Colliders 后,Unity 会在您将网格添加到场景中时自动添加一个网格碰撞体,以便物理系统将其视为实体。
如果游戏对象正在移动(例如汽车),则无法使用网格碰撞体。必须改用原始碰撞体。此情况下应禁用 Generate Colliders 设置。
尽可能将网格合并在一起。这些网格应该尽可能共享材质和纹理。这种做法可大幅提升性能。
如果需要在 Unity 中进一步设置游戏对象(添加物理设置、脚本或其他组件),请确保在 3D 应用程序中妥善命名游戏对象。使用 pCube17 或 Box42 之类的名称可能会很费力。
使网格在 3D 建模应用程序中的世界原点居中。这样可以使网格更容易在 Unity 中定位。
如果网格没有顶点颜色,Unity 会在第一次渲染网格时自动将全白色顶点颜色数组添加到网格。
Unity Editor 显示太多顶点或三角形(与 3D 建模应用程序中的原始模型相比)。
这是正常的。您正在查看的是实际发送到 GPU 进行渲染的顶点/三角形数量。除了材质要求发送两次这些顶点/三角形的情况之外,其他诸如硬法线和非连续 UV 的元素与 3D 建模应用程序显示的情况相比会显著增加顶点/三角形数量。三角形在 3D 和 UV 空间中都需要处于连续状态以形成条带,因此当有 UV 接缝时,必须使三角形退化以形成条带,而这会增加计数。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.