您的位置:首页 > 移动开发 > Unity3D

[基础教程] Unity3D Terrian地形设置中文教程

2016-02-24 10:51 274 查看
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.如下图所示



刚创建好的地形在场景视图中如下图.



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



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

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

Editing the Terrain 编辑地形

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



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

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

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

Terrain Keyboard Shortcuts 地形编辑的快捷键

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

Height 地形高度工具



使用这个工具,可以依据笔刷的类型及强度画出隆起或凹陷的地形(初始时不可用).按鼠标一次,就会隆起地

形.按住鼠标同时拖拽,可以不断隆起地形.直到达到最大高度.如下图所示.



如要凹陷地形,按住 Shift 键.如下图所示在做地形时,一个很重要的按键就是 F 键.多多用这个键吧.





第二个工具:最大高度工具



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





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





第四个工具:贴图工具



地形贴图就如角色贴图一样,是地形整体风貌.出于游戏整体性能和地形引擎数据结构的原因.地形的贴图数最好是 4 的倍数.

第五个工具:树木工具



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

树的参数如下:

Brush Size Radius in meters of the tree placing brush. 以米为单位,树的半径.一次画多少棵树

Tree Spacing Percentage of tree width between trees.树与树之间的百分数

Color Variation Allowed amount of color difference between each tree. 树与树之间颜色差的范围

Tree Height Height adjustment of each tree compared to the asset.场景中树与模型之间高度比

Height Variation Allowed amount of difference in height between each tree.树与树之间的高度比

Tree Width Width adjustment of each tree compared to the asset. 场景中树与模型之间宽度比

Width Variation Allowed amount of difference in width between each tree. 树与树之间的宽度比

第六个工具:Grass 画草工具



如上图就是画草的工具.当然它还可以画石头,或

其他可以作为地形装饰的东西.同样,需要先加草的贴图之后才能画.以下是它的参数.



最后一个工具:地形设置



Pixel Error

Amount of allowable errors in the display of Terrain Geometry. This is essentially a

LOD setting. 地形容差.

Base Map Dist.

The distance that Terrain Textures will be displayed in high-resolution.

高分辨率下显示地形贴图的距离.

Lighting

Vertex

Lightmap

Pixel

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. 像素灯光模式

Cast Shadows

Should terrain cast shadows?地形是否显示阴影

Tree & Detail Settings 树与细节的设置

Draw

If enabled, all trees, grass, and detail meshes will be drawn

是否可画.可用的话所有树,草和细节都渲染.必须为可用,不然看不到树,草和细节

.

Detail Distance

Distance from the camera that details will stop being displayed.

离摄像机多远之后不显示细节

Tree Distance

Distance from the camera that trees will stop being displayed. The higher this is, the

further-distance trees can be seen.同上,不过这个是关于树的

Billboard Start

Distance from the camera that trees will start appearing as Billboards instead of

Meshes.离摄像机多远树开始以图片而不是网格来显示

Fade Length

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

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

Max Mesh Trees

Total number of allowed mesh trees to be capped in the Terrain.

地形网格显示的最大数
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: