Unity3d-地形制作教程 - 图文

更新时间:2024-01-03 21:25:01 阅读量: 教育文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Unity3d-地形制作教程

Using Terrains 使用地形

Creating a new Terrain创建一个新的地形

A new Terrain can be created from Terrain->Create Terrain. This will add a Terrain to your Project and Hierarchy Views. 如要创建地形,点击Terrain->Create Terrain. 如下图所示

Your new Terrain will look like this in the Scene View: 刚创建好的地形在场景视图中如下图.

A new Terrain in Scene View

If you would like a differently sized Terrain, choose Terrain->Set Resolution from the menu bar. There are a number of settings that related to Terrain size which you can change from this dialog.

点击Terrain->Set Resolution,可以设置地形的大小.如下图所示.从上而下依次为地形的宽度,高度,长度,高度图像素,细节像素-草或其它细节贴图,像素,贴图像素—对应第二个及其之后的贴图,底层贴图像素-对应第一个贴图.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Setting the resolution of your terrain.

On the above image, there are values that can be changed. These values are:

? ? ? ? ? ? ?

Terrain Width: The width of the Terrain in units. Terrain Height: The height of the Terrain in units. Terrain Length: The length of the Terrain in units.

HeightMap Resolution: The HeightMap resolution for the selected Terrain.

Detail Resolution: The resolution of the map that controls grass and detail meshes. For performance reasons (to save on draw calls) the lower you set this number the better. Control Texture Resolution: The resolution of the splat map used to layer the different textures painted onto the Terrain.

Base Texture Resolution: The resolution of the composite texture that is used in place of the splat map at certain distances.

Navigating the Terrain

Terrains work a bit differently than other GameObjects. Most notably, there is no Transform Gizmo that allows you to position the Terrain. Instead, you use Brushes to paint and manipulate your Terrain. If you do want to reposition a Terrain, you can modify its Transform Position values in the Inspector. This allows you to move your Terrain around, but you cannot rotate or scale it.

地形对象与其他游戏对象有点不同,它没有转换轴,不可以通过鼠标直接改变它的坐标.如果要改变坐标,可以通过在属性面板修改.不过不可以旋转和缩放.

While your Terrain is selected in the Hierarchy, you can gracefully navigate the terrain with the F (focus) key. When you press F, wherever your mouse is positioned will be moved to the center of the Scene View. This allows you to touch up an area, and quickly zoom over to a different area and change something else. If your mouse is not hovering over an area of the Terrain when you press the F key, the entire Terrain will be centered in your Scene View.

地形被选择后,按F按可以以鼠标点击位置为中心察看地形.如果没有用鼠标点击任何一点,会以整个地形为中心察看地形.

Editing the Terrain 编辑地形

With the Terrain selected, you can look at the Inspector to see some incredible new Terrain editing tools.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

选择地形后,在属性面板会出现7个按钮以方便地形的编辑.从左到右依次为高度工具.特定高度工具.平滑工具.贴图工具.画树工具.细节工具.其他设置.如下图所示.

Terrain Editing Tools appear in the Inspector

Each rectangular button is a different Terrain tool. There are tools to change the height, paint splat maps, or attach details like trees or rocks. To use a specific tool, click on it. You will then see a short description of the tool appear in text below the tool buttons.

点击任何一个按钮,按钮下面都会出现关于此按钮的说明及相关的快捷键.

Most of the tools make use of a brush. Many different brushes are displayed for any tool that uses a brush. To select a brush, just click on it. The currently selected brush will display a preview when you hover the mouse over the terrain, at the size you have specified.

每个工具都有不同的笔刷.选取笔刷后,在地形上都会出现蓝色图形表示笔刷的范围.

You will use all of these brushes in the Scene View to paint directly onto your Terrain. Simply choose the tool and brush you want, then click & drag on the Terrain to alter it in real-time. To paint height, textures, or decorations, you must have the Terrain selected in the Hierarchy View.

花点时间熟悉这些工具.选取一个工具及笔刷,用拖放的方式就可以实时地编辑地形.F键,多用用这个键,你会发现没有它,修改地形是件困难与痛苦的事.享受它带来的方便吧…

Note: When you have a brush selected, move your mouse over the Terrain in the Scene View and press F. This will center the Scene View over the mouse pointer position and automatically zoom in to the Brush Size distance. This is the quickest & easiest way to navigate around your Terrain while creating it.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Terrain Keyboard Shortcuts 地形编辑的快捷键

While Terrain Inspector is active, those keyboard shortcuts can be used for fast editing (all of them customizable in Unity Preferences): 以下是地形编辑的快捷键.只有在地形被选取后才可用.

? ? ?

Shift-Q to Shift-Y selects active terrain tool. Shift-Q 到 Shift-Y 对应从左到右六个工具 Comma (,) and dot (.) cycle through active brush. 逗号和句号 向前或向后选取笔刷 Shift-comma (<) and Shift-dot (>) cycle through active tree/texture/detail object. Shift-逗号和Shift-句号 向前或向后选取树/贴图/细节物体.

以下是对各个工具的详细说明.

Height 地形高度工具

Using any of the Terrain editing tools is very simple. You will literally paint the Terrain from within the Scene View. For the height tools and all others, you just have to select the tool, and click the Terrain in Scene View to manipulate it in real-time.

使用地形工具画地形是很简单的.你所要做的就是选取工具,再用鼠标在地形上拖拽就可以实时地画出地形.不然,要画出游戏级别的地形,还要一张原画以及多多的练习.总体的思路就是先画高度,再分出层次,画贴图,画树以及增加细节.

Raising & Lowering Height

The first tool on the left is the Raise Height tool

.

第一个工具:地形高度工具.

With this tool, you paint brush strokes that will raise the height of the Terrain. Clicking the mouse once will increment the height. Keeping the mouse button depressed and moving the mouse will continually raise the height until the maximum height is reached.

使用这个工具,可以依据笔刷的类型及强度画出隆起或凹陷的地形(初始时不可用).按鼠标一次,就会隆起地形.按住鼠标同时拖拽,可以不断隆起地形.直到达到最大高度.如下图所示.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

You can use any of the brushes to achieve different results 使用不同的笔刷可以得到不同的效果.

If you want to lower the height when you click, hold the Shift key. 如要凹陷地形,按住Shift 键.如下图所示 在做地形时,一个很重要的按键就是F键.多多用这个键吧.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Note:When you have a brush selected, move your mouse over the Terrain in the Scene View and press F. This will center the Scene View over the mouse pointer position and automatically zoom in to the Brush Size distance. This is the quickest & easiest way to navigate around your Terrain while creating it.

Paint Height

The second tool from the left is the Paint Height tool

.

第二个工具,最大高度工具. 可以设定最大高度,当达到这个高度后,地形就不再加高.周围高度一样时,就会变平.这个工具用于分出地形高度的层次.Shift键在这个工具上的用途是选取最大高度.

This tool allows you to specify a target height, and move any part of the terrain toward that height. Once the terrain reaches the target height, it will stop moving and rest at that height.

To specify the target height, hold Shift and click on the terrain at the height you desire. You can also manually adjust the Height slider in the Inspector.

Now you've specified the target height, and any clicks you make on the terrain will move the terrain up or down to reach that height. 下图所示,最大高度工具的应用.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Smoothing Height

The third tool from the left is the Smoothing Height tool

.

第三个工具是高度平滑工具.用于再个不高度地形之间的过渡部分.这样地形不会有棱有角.如下图所示.

This tool allows you to soften any height differences within the area you're painting. Like the other brushes, paint the areas you want to smooth in the Scene View.

Working with Heightmaps 高度图创建地形

If you like, you can import a greyscale Heightmap created in Photoshop, or from real-world geography data and apply it to your Terrain. To do this, choose Terrain->Import Heightmap - Raw..., then select

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

the desired RAW file. You'll then see some import settings. These will be set for you, but you have the option of changing the size of your Terrain from this dialog if you like. When you're ready, click the Import button. Once the Heightmap has been applied to the Terrain, you can edit it normally with all the Tools described above. Note that the Unity Heightmap importer can only import grayscale raw files. Thus you can't create a raw heightmap using RGB channels, you must use grayscale.

用Photoshop或其他3D软件导出灰度图 可以使用灰度图来创建地形.灰度图的格式应为RAW格式.点击, Terrain->Import Heightmap – Raw 出现对话框,可以修改地形的大小.点击Import就可以创建地形了.创建好后,你可以使用所有的地形工具再进行编辑. Unity可以支持16位的灰度图.可以通过Photoshop,Bryce,Terragen这几个软件来创建灰度图.同样,可以在Unity中导出灰度图. 在

Terrain->Import Heightmap - Raw...对话框中,点击Export.就OK. 通过Terrain->Flatten....命令可以将地形整体设置一个高度.这个命令最好在最初使用.不然,做好的地形会变成平面.需要重新编辑.

Unity works with RAW files which make use of full 16-bit resolution. Any other heightmap editing application like Bryce, Terragen, or Photoshop can work with a Unity Heightmap at full resolution.

You also have the option of exporting your Heightmap to RAW format. Choose Terrain->Import Heightmap - Raw... and you'll see a export settings dialog. Make any changes you like, and click Export to save your new Heightmap.

Unity also provides an easy way to flatten your terrain. Choose Terrain->Flatten.... This lets you flatten your terrain to a height you specify in the wizard.

Textures 给地形加贴图

Decorate the landscape of your terrain by tiling Terrain Textures across the entire terrain. You can blend and combine Terrain Textures to make smooth transitions from one map to another, or to keep the surroundings varied. 地形贴图就如角色贴图一样,是地形整体风貌.出于游戏整体性能和地形引擎数据结构的原因.地形的贴图数最好是4的倍数.

Terrain Textures are also called splat maps. What this means is you can define several repeating high resolution textures and blend between them arbitrarily, using alpha maps which you paint directly onto the Terrain. Because the textures are not large compared to the size of the terrain, the distribution size of the Textures is very small.

Note: Using an amount of textures in a multiple of four provides the greatest benefit for performance and storage of the Terrain alpha maps.

To being working with textures, click on the Paint Textures button下图所示就是贴图画笔

in the Inspector.

Adding a Terrain Texture为地形增加贴图

Before you can begin painting Terrain Textures, you will add at least one to the Terrain from your Project folder. Click the Options Button->Add Texture.... 如图所示, Options Button->Add Texture....你需要为地形增加贴图,才能用贴图来画地形.第一个地形会作用于整个地形.第二个之后的贴图才能用笔刷画.重复以上步骤就可以为地形增加需要的贴图了.如果要更换贴图,就在当前贴图选取后(被选取的贴图会以高亮蓝

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

色表示),点击Edit Texture,之后就可以重新选取贴图.另一个Remove Texture 就是移除贴图.贴图尺寸越小,过渡会越自然.反之亦然.

This will bring up the Add Terrain Texture dialog.

The Add Terrain Texture dialog 在Splat 中选取需要的贴图文件.第二三个参数是贴图的尺寸大小. From here, select a tileable texture in the Splat property. You can either drag a texture to the property from the Project View, or choose one from the drop-down.

Now, set the Tile Size X and Tile Size Y properties. The larger the number, the larger each \texture will be scaled. Textures with large Tile Sizes will be repeated fewer times across the entire Terrain. Smaller numbers will repeat the texture more often with smaller tiles.

Click the Add Button and you'll see your first Terrain Texture tile across the entire Terrain.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Repeat this process for as many Terrain Textures as you like.

Painting Terrain Textures 画地形贴图

Once you've added at least two Terrain Textures, you can blend them together in various ways. This part gets really fun, so let's jump right to the good stuff. 为地形增加了两个或以上贴图后,就可以使用贴图画地形了.选取贴图和笔刷,用鼠标在地形上拖拽,画贴图就是如此简单.画贴图时记得使用F和Alt键,这样的效率会更高.

Select the Terrain Texture you want to use. The currently selected Terrain Texture will be highlighted in blue.

Select the Brush you want to use. The currently selected Brush will be highlighted in blue.

Select the Brush Size, Opacity, and Target Strength.

Click and drag on the terrain to draw the Terrain Texture.上图从上而下参数为:笔刷大小,透明度,笔刷强度

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Use a variety of Textures, Brushes, Sizes, and Opacities to create a great variety of blended styles.

不同的笔刷,大小和透明度可以得到不同的效果.

Note:When you have a brush selected, move your mouse over the Terrain in the Scene View and press F. This will center the Scene View over the mouse pointer position and automatically zoom in to the Brush Size distance. This is the quickest & easiest way to navigate around your Terrain while creating it.

Trees

Unity's Terrain Engine has special support for Trees. You can put thousands of trees onto a Terrain, and render them in-game with a practical frame rate. This works by rendering trees near the camera in full 3D, and transitioning far-away trees to 2D billboards. Billboards in the distance will automatically update to orient themselves correctly as they are viewed from different angles. This transition system makes a detailed tree environment very simple for performance. You have complete control over tweaking the parameters of the mesh-to-billboard transition so you can get the best performance you need.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

You can easily paint lots of trees for beautiful environments like this

Adding Trees 增加树木

Select the Place Trees button

in the Inspector.

Before you can place trees on your terrain, you have to add them to the library of available trees. To do this, click the Edit Trees button->Add Tree. You'll see the Add Tree dialog appear.

The Add Tree dialog

Select the tree from your Project View and drag it to the Tree variable. You can also edit the Bend Factor if you want to add an additional bit of animated \you're ready, click Add. The tree will now appear selected in the Inspector.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

The newly added tree appears selected in the Inspector

You can add as many trees as you like. Each one will be selectable in the Inspector for you to place on your Terrain.

The currently selected tree will always be highlighted in blue

增加树和增加贴图是一样的,所不同的只是Blend factor 这个参数,如果要有树在风中摇摆的效果,就设置为1 或以上,不要风的效果就设置为0. 按住Shift, 可以移除树.还是两个快捷键 F键和Alt键.可以提高效率.

Painting Trees

While still using the Place Trees tool, click anywhere on the Terrain to place your trees. To erase trees, hold the Shift button and click on the Terrain.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Painting trees is as easy as using a paintbrush tool

There are a number of options at your disposal when placing trees. 树的参数如下

Brush Size Tree Spacing Color Variation Tree Height Height Variation Tree Width Width Variation

Radius in meters of the tree placing brush. 以米为单位,树的半径.一次画多少棵树 Percentage of tree width between trees.树与树之间的百分数

Allowed amount of color difference between each tree. 树与树之间颜色差的范围 Height adjustment of each tree compared to the asset.场景中树与模型之间高度比 Allowed amount of difference in height between each tree.树与树之间的高度比 Width adjustment of each tree compared to the asset. 场景中树与模型之间宽度比 Allowed amount of difference in width between each tree. 树与树之间的宽度比

Tree Painting Tips 技巧:不同区域选用不同的笔刷类型.通过树之间的距离(Tree Space)来表现树的疏密.

Different Brush sizes cover different area sizes

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Adjust Tree Spacing to change the density of the trees you're painting

Editing Trees通过Edit Trees button->Edit Detail 或双击树,会出现对话框,可以设置树的参数.

To change any import parameters for an added tree, select the detail and choose Edit Trees

button->Edit Detail. Or double-click the tree you want to edit. You will then see the Edit Tree dialog, and you can change any of the settings.

Mass Placement If you don't want to paint your trees and you just want a whole forest created, you

can use Terrain->Mass Place Trees. Here, you will see the Mass Place Trees dialog. You can set the number of trees you want placed, and they'll be instantly positioned. All the trees added to your Terrain will be used in this mass placement. 通过Terrain->Mass Place Trees, 可以一次增加数量巨大的树.下图一次增加一万棵树.树的类型以当前选取的为准.

10,000 Trees placed at once

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Refreshing Source Assets

If you make any updates to your tree asset source file, it must be manually re-imported into the Terrain. To do this, use Terrain->Refresh Tree and Detail Prototypes. This is done after you've changed your source asset and saved it, and will refresh the trees in your Terrain immediately.

如果使用第三方软件修改树的模型.需要使用Terrain->Refresh Tree and Detail Prototypes.来更新

Creating Trees 自定义树

Every tree should consist of a single mesh with two Materials. One for the trunk and one for the leaves. For performance reasons, triangle count should be kept below 2000 for an average tree. The fewer triangles the better. The pivot point of the tree mesh must be exactly at the root of the tree, that is at the point where the tree should meet the surface it is placed on. This makes it the easiest to import into Unity and other modelling applications.

树的模型由一个网格加两个材质组成.一个材质用于树干,另一材质用于树叶.基于性能上的考虑,一棵树的三角面数应少于2000.越少性能越好.树的轴中心应刚好在树根.树干的材质文件命名为:树的文件名+ Bark,树叶的命名为树的文件名+ Branch.模型文件以FBX格式存放.如需一次画一棵以上的树,需再做一个模型,把好几棵树放在一个FBX文件里.模型文件名与文件夹的名称要一致.可以参考官方的模型,之后再创建模型.

Trees must use the Nature/Soft Occlusion Leaves and Nature/Soft Occlusion Bark shader. In order to use those shaders you also have to place the tree in a special folder that contains the name \ambient occlusion specialized for trees. The \you don't follow the naming conventions the tree will look weird with completely black parts.

树需要使用Nature/Soft Occlusion Leaves 和 Nature/Soft Occlusion Bark shader 这两个效果.把树的整个文件夹放到Trees Ambient-Occlusion夹内.在Unity 项目面板里找到自定义树的FBX文件,在属性面板可以看到shader 选取项.在下拉菜单为树干选取Nature/Soft Occlusion Bark 效果.为树叶选取Nature/Soft Occlusion Leaves 效果. 从官方网站上可以下载到Terrain Demo.unitypackage, 这个资源包里有不少树,可以商用.如果真的需要自定义树模型,最好也好好看看官方的树是怎么建模,明白之后再进行建模.

Unity also ships with several high quality trees in the \trees readily in your game. Even if you don't want to use the builtin trees, we strongly recommend that you take a look at those trees as an example on how to model trees.

Using Low Poly Trees 低模树创建

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

One branch with leaves is done with only six triangles and shows quite a bit of curvature. You can add more triangles for even more curvature. But the main point is: When making trees, work with triangles not with quads. If you use quads you basically need twice as many triangles to get the same curvature on branches. 一个树叉用六个三面效果还不错,如果要更好,可以增加三角面.重点就是需三角而不是四角来创建模型.如果用四角,可以把它分成两个三角面.,

The tree itself wastes a lot of fillrate by having large polygons but almost everything is invisible due to the alpha. This should be avoided for performance reasons and of course because the goal is to make dense trees. This is one of the things that makes Oblivion's trees look great. They are so dense you cant even see through the leaves. 树的模型如有大多边形时,因透明通道的原因.会很浪费内存,同时会导致不可见.这是必须避免的,以提高性能.更重要的是,我们的目标是通过三角面做茂密的树.茂密得可以我们的眼睛都没法穿透它.

Setting up Tree Collisions设置树的碰撞.

If you'd like your trees to make use of colliders, it's very easy. When you've imported your Tree asset file, all you need to do is instantiate it in the Scene View, add a Capsule Collider and tweak it, and make the GameObject into a new Prefab. Then when you're adding trees to your Terrain, you add the tree Prefab with the Capsule Collider attached. You can only use Capsule Colliders when adding collisions with trees. 设置树的碰撞是件很简单的事情.只需要把树拖入场景,加上Capsule Collider 这个碰撞,再做成预制就可以了.在加树的时候选取这个预制就OK.

Grass 画草工具

The Paint Foliage button

allows you to paint grass, rocks, or

other decorations around the Terrain. To paint grass, choose Edit Details button->Add Grass Texture. You don't need to create a mesh for grass, just a texture. 如上图就是画草的工具.当然它还可以画石头,或其他可以作为地形装饰的东西.同样,需要先加草的贴图之后才能画.以下是它的参数.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

The Add Grass Texture dialog

At this dialog, you can fine-tune the appearance of the grass with the following options:

Detail Texture The texture to be used for the grass.草的贴图

Min Width Minimum width of each grass section in meters.以米为单位,草的最小宽度 Max Width Maximum width of each grass section in meters. 以米为单位,草的最大宽度 Min Height Minimum height of each grass section in meters. 以米为单位,草的最小高度 Max Height Maximum height of each grass section in meters. 以米为单位,草的最大高度 Noise Spread The size of noise-generated clusters of grass. Lower numbers mean less noise 树叶变黄生成器的大小,数值越小,变黄范围越小.

Healthy Color Color of healthy grass, prominent in the center of Noise Spread clusters. 健康叶的颜色.树叶中心的颜色

Dry Color

Color of dry grass, prominent on the outer edges of Noise Spread clusters. 树叶干枯的颜色.树叶变黄外围的颜色

Grayscale Lighting If enabled, grass textures will not be tinted by any colored light shining on the

Terrain.灯光灰度.如果设置为可用,树叶会以灰度图渲染.

Lightmap Factor How much the grass will be influenced by the Lightmap. Lightmap的影响范围 Billboard

If checked, this grass will always rotate to face the main Camera. 如可用,草会总以主摄像机为中心旋转

After you've clicked the Add button, you'll see the grass appear selectable in the Inspector.

. Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

The added grass appears in the Inspector 上图为在属性面板上加入草贴图后的效果

Painting Grass 画草.方法和上面的工具一样.就不多言了.同样记得F键和Alt键.

Painting grass works the same as painting textures or trees. Select the grass you want to paint, and paint right onto the Terrain in the Scene View

Painting grass is easy as pie

Note:When you have a brush selected, move your mouse over the Terrain in the Scene View and press F. This will center the Scene View over the mouse pointer position and automatically zoom in to the Brush Size distance. This is the quickest & easiest way to navigate around your Terrain while creating it.

Editing Grass 草的编辑和树的一样.对比下图.修改参数最小/最大高/宽度来让它来点变化

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

To change any import parameters for a particular Grass Texture, select it choose Edit Details

button->Edit. You can also double-click it. You will then see the Edit Grass dialog appear, and be able to adjust the parameters described above.

You'll find that changing a few parameters can make a world of difference. Even changing the Max/Min Width and Height parameters can vastly change the way the grass looks, even with the same number of grass objects painted on the Terrain.

Grass created with the default parameters默认参数下的草

The same number of painted grass objects, now wider and taller 修改宽度和高度的效果

Detail Meshes 细节网格

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Any Terrain decoration that is not trees or grass should be created as a Detail Mesh. This is perfect for things like rocks, 3D shrubbery, or other static items. To add these, use the Paint Foliage button

. Then choose Edit Details button->Add Detail Mesh. You

will see the Add Detail Mesh dialog appear.在加草的工具上还可以增加细节网格物体.比如石头或其他可以装饰的物体.以下是其参数

The Add Detail Mesh dialog

Detail Noise Spread Random Width Random Height Healthy Color Dry Color

The mesh to be used for the detail.用作细节的网格物体.

The size of noise-generated clusters of the Detail. Lower numbers mean less noise 细节燥波的大小..

Limit for the amount of width variance between all detail objects.随机宽度 Limit for the amount of height variance between all detail objects.随机高度 Color of healthy detail objects, prominent in the center of Noise Spread clusters. 细节物体的健康色.细节物体中心的颜色

Color of dry detail objects, prominent on the outer edges of Noise Spread clusters 细节物体的干燥色.细节物体外围的颜色..

Grayscale Lighting If enabled, detail objects will not be tinted by any colored light shining on the

Terrain.灰度灯的设置开关.可用的话,细节物体不带颜色.

Lightmap Factor Render Mode

How much the detail objects will be influenced by the Lightmap .Lightmap的影响范围

Select whether this type of detail object will be lit using Grass lighting or normal Vertex lighting. Detail objects like rocks should use Vertex lighting. 细节物体渲染的方式.用草的灯光渲染或用正常的锥形灯渲染

After you've clicked the Add button, you'll see the Detail mesh appear in the Inspector. Detail meshes and grass will appear next to each other. 画细节的和草是一样的.就不多说了.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

The added Detail mesh appears in the Inspector, beside any Grass objects

Painting Detail Meshes

Painting a Detail mesh works the same as painting textures, trees, or grass. Select the Detail you want to paint, and paint right onto the Terrain in the Scene View.

Painting Detail meshes is very simple

Note: When you have a brush selected, move your mouse over the Terrain in the Scene View and press F. This will center the Scene View over the mouse pointer position and automatically zoom in to the Brush Size distance. This is the quickest & easiest way to navigate around your Terrain while creating it.

Editing Details 修改细节物体.双击或用Edit Details button->Edit.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

To change any import parameters for a Detail Mesh, select it and choose Edit Details button->Edit. You will then see the Edit Detail Mesh dialog appear, and be able to adjust the parameters described above.

Refreshing Source Assets

如果用第三方软件修改细节网格后,需要用Terrain->Refresh Tree and Detail Prototypes.来更新. If you make any updates to your Detail Mesh asset source file, it must be manually re-imported into the Terrain. To do this, use Terrain->Refresh Tree and Detail Prototypes. This is done after you've changed your source asset and saved it, and will refresh the Detail Meshes in your Terrain immediately.

Lightmaps 灯光贴图

You can create and use a Lightmap, based on the Lights in your Scene. You should almost always use Lightmaps. A Lightmapped terrain looks substantially better than Vertex lit. On top of that a Lightmapped terrain also runs faster than a Vertex lit terrain! 基于场景里的灯光,可以创建灯光贴图.要做好地形,灯光贴图是必须的.对比下面两张图.第一张没有灯光贴图.第二张用了灯光贴图.

A mountain view without a Lightmap

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

The same mountain, now using a Lightmap. Much better!

Creating a Lightmap

To create a Lightmap, make sure you have at least one Directional Light in your scene. Then choose Terrain->Create Lightmap from the menu. Here you can set various options like the Resolution of the Lightmap, choose the Lights used in the Lightmap, Shadows, and Shadow Sampling.

为了创建灯光贴图.场景中必须至少要有一个平行灯.通过Terrain->Create Lightmap 就可以创建灯光贴图.可以设置的参数比如分辩率,阴影,阴影取样.

Toggling Lightmap

To enable or disable the active Lightmap, select your Terrain and click the Terrain Settings tab. In Lighting popup, choose Lightmap or Pixel lighting mode.

通过地形设置选项:如下图可以开启和关闭灯光贴图.灯光贴图必须使用平等灯才可用.

Note: You must use a Directional Light to create the lightmap. Point and Spot Lights will not be taken into account when creating the lightmap.

Other Settings 地形设置 最后一个按键.参数 如下

There are a number of options under the Terrain Settings button

in the Terrain Inspector.

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

All additional Terrain Settings Base Terrain

Pixel Error Base Map Dist. Lighting Vertex Lightmap Pixel

Cast Shadows

Amount of allowable errors in the display of Terrain Geometry. This is essentially a LOD setting. 地形容差.

The distance that Terrain Textures will be displayed in high-resolution. 高分辨率下显示地形贴图的距离. Terrain lighting mode:地形灯光模式.

Terrain is lit by lights in vertex lit mode. 顶点灯光模式

Terrain uses lightmap and is not affected by lights.灯光贴图模式

Terrain is lit by pixel & vertex lights up close, and fades out to lightmap in the distance. Close by it can also receive shadows. 像素灯光模式 Should terrain cast shadows?地形是否显示阴影

Tree & Detail Settings 树与细节的设置

Draw

Detail Distance Tree Distance Billboard Start Fade Length

If enabled, all trees, grass, and detail meshes will be drawn .是否可画.可用的话所有树,草和细节都渲染.必须为可用,不然看不到树,草和细节 Distance from the camera that details will stop being displayed. 离摄像机多远之后不显示细节

Distance from the camera that trees will stop being displayed. The higher this is, the further-distance trees can be seen.同上,不过这个是关于树的

Distance from the camera that trees will start appearing as Billboards instead of Meshes.离摄像机多远树开始以图片而不是网格来显示

Total distance delta that trees will use to transition from Billboard orientation to

Translate by Frank Copy Right Reversed No Commercial 转载需注明出处.

Mesh orientation.树的图片和网格方式显示距离.

Max Mesh Trees

Total number of allowed mesh trees to be capped in the Terrain. 地形网格显示的最大数

Wind Settings 风的设置

Speed Size Bending Grass Tint

The speed that wind blows through grass. 风的速度

The areas of grass that are affected by wind all at once. 风可影响的范围 Amount that grass will bend due to wind.受风影响的树的数量

Overall tint amount for all Grass and Detail Meshes.彩色显示草和细节的总数

本文来源:https://www.bwwdw.com/article/bhwx.html

Top