使用 Paint Holes 工具可隐藏地形的某些部分。此工具可用于在地形中绘制地层(例如洞穴和悬崖)的开口。
要访问该工具,请单击 Paint Terrain 图标,然后从下拉菜单中选择 Paint Holes。
要绘制孔洞,请在地形上单击并拖动光标。在按住 Shift 键的同时单击并拖动可从地形中抹去孔洞。使用 Brush Size 滑动条可控制工具的大小。Opacity 滑动条可确定将画笔应用于地形时的强度。
Unity 在内部使用纹理来定义地形表面的不透明度遮罩。使用 Paint Holes 工具在地形上进行绘制时,该工具会修改此纹理。因此,仅当使用的地形材质根据该遮罩来裁剪或丢弃纹素时,绘制的任何孔洞才可见。
因为此工具使用纹理,所以可能会在绘制的孔洞周围看到锯齿状边缘。因此,例如,制作洞穴时,可以选择使用其他几何体(例如岩石网格)来隐藏该孔洞的锯齿边缘。
地形孔洞可使用光照、物理和导航网格 (NavMesh) 烘焙。Unity 会在您绘制孔洞的区域中丢弃地形信息以确保光照、地形碰撞体和烘焙导航网格的准确性。
为了支持物理碰撞体,孔洞的遮罩纹理的分辨率等于地形高度贴图的分辨率 - 1。
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.