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 细节网格
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库Unity3d-地形制作教程 - 图文(4)在线全文阅读。
相关推荐: