1 / 55

Introduction to Terrain

Introduction to Terrain. Sai -Keung Wong National Chiao Tung University, Taiwan. Contents. Introduction to terrain Creation of terrain Terrain material Foliage. Terrain. It’s an actor in UDK. Height map Terrain materials Foliage. Terrain actor. Create a terrain actor

aadi
Download Presentation

Introduction to Terrain

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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-10241024-20482048-40964096-81928192+ • Controlled by TessellationDistanceScale property

  16. Terrain Properties(地形属性) • DecoLayers(装饰层) • Show all the theDecoLayers 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. TerrainMaterials

  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. Foliage(植被) • Select a terrain material in Terrain editing browser • Under Foliage(植被) • ->“FoliageMeshes”->“Add New Item” • And then select a static mesh

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

  47. Terrain Material Example

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

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

More Related