将绘制纹理 (Paint Texture) 或平滑高度 (Smooth Height) 等工具应用于地形时,Unity 会使用画笔(这是地形系统中的 ScriptableObject)。画笔定义了工具的形状和影响强度。
Unity 附带了一组内置画笔。这些画笔包括用于快速草绘设计的简单圆圈以及用于表现细节和自然外观特征的更随机的散射形状。
可根据需要创建具有独特形状或特定参数的自定义画笔。例如,使用特定地质特征的高度贴图纹理来定义画笔,然后使用地形图章 (Stamp Terrain) 工具将该特征放置在地形上。
要创建新画笔,请单击 Terrain Inspector 窗口中的 New Brush 按钮。
单击 New Brush 后,将出现 Select Texture2D 窗口。选择一个纹理以定义新画笔的形状,然后使用 Brush Inspector 调整 Falloff 和 Radius Scale 值。
或者,在 Project 窗口中单击鼠标右键,然后选择 Create > Brush 以创建新画笔。默认画笔显示一个由白色 Mask Texture、Falloff 曲线和值为 1 的 Radius Scale 定义的简单圆圈。使用 Brush Inspector 可更改这些值,或设置纹理以定义画笔的形状。还可以使用 Remap 滑动条和 Invert Remap Range 选项来进一步修改__画笔__纹理的灰度值。
属性 | 功能 |
---|---|
Mask Texture | 定义画笔的形状和强度。在项目中选择纹理,系统将根据纹理创建灰度遮罩。如果所选纹理具有多个颜色通道,则画笔将使用红色通道作为其源。 |
Remap | 应用衰减 (Falloff) 曲线后重新映射画笔遮罩的灰度值。Editor 将画笔遮罩中的黑色值重新映射到您使用滑动条左侧选择的值,并将画笔遮罩中的白色值重新映射到使用滑动条右侧选择的值。 |
Invert Remap Range | 反转 Remap 滑动条的左侧和右侧,本质上是反转整个遮罩的值。 |
Falloff | 定义以圆形方式影响画笔强度的曲线。单击衰减 (Falloff) 曲线可打开 Unity 曲线编辑器 (Curve Editor),然后可以在其中编辑该曲线以创建平滑淡入淡出和锐利边缘等各种效果。 |
Radius Scale | 影响衰减曲线的比例。使用此选项可增大或减小曲线的半径。 |
2019–10–22 页面已修订
更新了屏幕截图以匹配新的 UI,并添加了有关 Brush Inspector 中的新选项的信息。
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.