Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Terrain Sai-Keung Wong National Chiao Tung University, Taiwan.

Similar presentations


Presentation on theme: "Introduction to Terrain Sai-Keung Wong National Chiao Tung University, Taiwan."— Presentation transcript:

1 Introduction to Terrain Sai-Keung Wong National Chiao Tung University, Taiwan

2 Contents Introduction to terrain Creation of terrain Terrain material Foliage

3 Terrain It’s an actor in UDK. Height map Terrain materials Foliage

4 Terrain actor Create a terrain actor – Content browser->actor->terrain – Press F4 to show property window – Terrain->patches – X:128 – Y:128 Observe the size changed.

5 Terrain actor

6 Light source A problem? Need a light source! Now, we should place a light source. Which type? – Spotlight? Try to create one and see the effect. – Point light? – Directional light? – Skylight? Try to create one and see the effect.

7 Light source Create a directional light source. Now set Terrain Editing Mode It’s a user-friendly interface for creating terrain.

8 Terrain editing Select paint, then CTRL+“press” left mouse button Don’t click, but press! May change Strength, Radius. paint

9 Top view + Lighting only Perspective view

10 Game Mode in Terrain

11 Smooth

12 Tools Add/remove sectors Paint vertex Paint Smooth Flatten etc

13 Terrain Anatomy (地形剖析) Press F4 after a terrain actor is selected.

14 Terrain Anatomy (地形剖析) Patches A set of triangular meshes. Every two triangles form a patch Components – A group of patches, for collision detection and occlusion culling Height Map (高度圖) A gray level image The intensity represents the height of a vertex Size = (#XPatches+1 ) × ( #YPatches+1 )。

15 Tessellation (多边形细分) The patches shown to the player depended on the distance. When it’s closer, more patches are shown. Level of details; 5 levels; distance ranges: 0-1024 1024-2048 2048-4096 4096-8192 8192+ Controlled by TessellationDistanceScale property

16 Terrain Properties (地形属性) DecoLayers (装饰层) Show all the the DecoLayers of terrain. Layers (图层) Show all the layers of terrain NumPatchesX ( Xpatches 数量) The number of patches along the X-axis at the highest level. NumPatchesY ( Ypatches 数量) The number of patches along the Y-axis at the highest level.

17 Terrain Properties MaxComponentSize (最大组件尺寸) Used for occlusion culling Example, if it is set as 4, then every component is computed as 4x4 patches If the value is too high, some objects may not be seen even though it’s close to the player. If the value is too low, the computation cost is expensive.

18 Terrain Properties MaxTessellationLevel (最高多边形细分水平) It’s a value of a power of 2, between 1 and 16. That is, 1, 2, 4, 8, and 16. Default value is 4. Try different values and play the game in wireframe mode to observe the changes.

19 Terrain Properties MinTessellationLevel (最低多边形细分水平) EditorTessellationLevel (编辑器多边形细分 水平) TessellationDistanceScale (多边形细分距离 比例) NormalMapLayer (法线贴图层)

20 Lighting Properties (光照属性) bIsOverridingLightResolution / StaticLightingResolution ( bIsOverriding 光源 分辨率 / 静态光照分辨率) Contrlol the quality of static shadows 这 bIsOverridingLightResolution ignores the setting of StaticLightingResolution

21 Collision Properties (碰撞属性) CollisionTessellationLevel (碰撞多边形细分 水平) The values is from 1 to MaxTesselationLevel and it’s a power of 2.

22 Terrian Materials (地形材质)属性 Select a terrain material and the following dialogue is shown. Click it

23 TerrianMaterials (地形材质)属性 DisplacementMap (位移贴图) Used to change the surface pixels along the normal vectors of the pixels. It’s a 32-bit image whose graphics file format is Targa(TGA)

24 TerrianMaterials (地形材质)属性 DisplacementScale (位移比例) A scale factor is applied when DisplacementMap is used. Foliage (植被) Allow to place static meshes which are associated with a terrain material.

25 TerrianMaterials (地形材质)属性 MappingPanU (贴图坐标平移 U ) – Move the material along the U-axis MappingPanV (贴图坐标平移 V ) – Move the material along the V-axis MappingRotation (贴图坐标旋转) – Rotate the material

26 TerrianMaterials (地形材质)属性 MappingScale (贴图坐标比例) – Multiply with texture coordinates MappingType (贴图坐标类型) – Alignment methods for materials – TMT_Auto – auto, best method evaluated by UDK – TMT_XY – 沿 XY 平面对齐材质。 – TMT_XZ – 沿 XZ 平面对齐材质。 – TMT_YZ – 沿 YZ 平面对齐材质。 Material – Contains Terrain Materials

27 Terrain layers TerrainMaterials (地形材质) group materials of different layers that are easier to manage terrain.

28 TerrainMaterials Click it

29 TerrainMaterials

30

31 Layer Functions New Layer Before This Item (在此对象前新 建图层) New Layer (新建图层) New Layer After This Item (在此对象后新建 图层)

32 Layer Functions New Layer from Material (auto-create) (新建图层自 材质(自动创建)) – Select a material in Generic Browser first Add Selected Layer Before This Item (在此对象前添 加選中图层) – Select a terrain layer in Generic Browser first Add Selected Layer (添加已選图层) – Select a a terrain later in Generic Browser first Add Selected Layer After This Item (在此对象后添加 已選图层) – Select a terrain layer in Generic Browser first

33 Material Functions New Material Before This Item (在此对象前 新建材质) New Material (新建材质) New Material After This Item (在此对象后 新建材质)

34 Material Functions Add Selected Material Before This Item (在此对象前添加 選中材质) – Select a terrain material in Generic Browser first Add Selected Material (添加已選材质) – Select a terrain material in Generic Browser first Add Selected Material After This Item (在此对象后添加 已選材质) – Select a terrain material in Generic Browser first Add Selected Displacement (添加已選位移) – Select a texture in Generic Browser first Add Selected Foliage (添加已選植被) – Select a terrain material with Foliage in Generic Browser first

35 DecoLayer Functions New DecoLayer Before This Item (在此对象前新建装饰 层) New DecoLayer (新建装饰层) New DecoLayer After This Item (在此对象后新建装饰层) Add Selected Decoration Before This Item (在此对象前增 加已選装饰物) – Make sure a Decoration is selected in Generic Browser first Add Selected Decoration (添加已選装饰物) – Make sure a Decoration is selected in Generic Browser first Add Selected Decoration After This Item (在此对象后添 加已選装饰物)

36 Terrain Creation Right click->New terrain setup layer Click it to modify

37 Terrain Creation Click this to select material for that layer

38 Terrain Creation Assign material to the surface: Right click->New Terrain Material

39 Terrain Creation

40 Result It’s too dark! What should you do?

41 Blending two textures. Both Alpha = 0.5

42 Blend Two Materials Change base minimum height for one material.

43 Red: Minimum height = 1000 Green: nil Red: Minimum height = 1000 Green: Maximum height = 1500

44 Map Material to a BSP Plane

45

46 Foliage (植被) Select a terrain material in Terrain editing browser Under Foliage (植被) -> “FoliageMeshes”->“Add New Item” And then select a static mesh

47 Foliage Generic Browser Select a static mesh Then “Use Current Selection” in FoliageMeshes for the terrain material

48 Terrain Material Example

49 Foliage Set the properties as follows: Density (密度) : 1 MaxDrawRadius (最大绘制半径) : 10000 MinTransitionRadius (最小转换半径) : 7000 MinScale (最小比例) : 3 MaxScale (最大比例) : 8 SlopeRotationBlend (坡度旋转混合) : 1.0

50 Foliage Go back to terrain editing dialogue Strength (强度) : 50 Radius (半徑) : 200 Falloff (落差) 170

51 Foliage Now, you can place the grasses (static meshes) anywhere you like. Only click Left Mouse button

52 Layers of Terrain

53 Example

54

55 Suggestions Try to play with something simple first – Simple textures and materials Try out different settings and play the game – Understand their effects Gradually decorate your game level – To make sure you know what you are doing


Download ppt "Introduction to Terrain Sai-Keung Wong National Chiao Tung University, Taiwan."

Similar presentations


Ads by Google