3D Game Programming All in One
description
Transcript of 3D Game Programming All in One
3D Game Programming All in One
By Kenneth C. Finney
Chapter 12
Terrains
Terrains
• For outdoor game environments
• Terrain is a topography model combined with ground cover textures
Terrains
Terrains Explained– Tiles are the basic terrain unit– Terrain tiles are a collection of
polygons, like any other 3D model
Terrains
Terrains Explained– Fidelity : accuracy of terrain– Spread : uniqueness of terrain
areas, related to tile repetition– Freedom : ability of player
characters to move within the terrain
Terrains
Terrains Explained
Terrain Data can be obtained from
U.S. Geological Survey
Formats: – Digital Elevation Model (DEM)– Digital Terrain Model (DTM)– Spatial Data Transfer Standard
(SDTS)
Terrains
Terrain Modeling
• External modeling method: terrain as another object in the game world
• Internal method: game engine contains specialized terrain rendering code
Terrains
Height Maps
• Grayscale images (8 bits per pixel) that represent terrain
• Similar to topographical maps
• Resolution is an issue (leads to either small tiles, or poor fidelity)
Terrains
Terrain Cover
• Textures used to represent soil types, flora, debris, and litter– Grass, Flowers, Dirt, Pebbles– Rocks, Trash, Litter, Pavement– Concrete, Moss, Sand, Stone
Terrains
Tiling
• Issues similar to those found in structure textures– seamless transitions– appropriate lighting
Terrains
Lab 1: Terrain
• Use paint program to create height map from a contour map
• Mathematically determine required image sizes
• Use the Terraform Editor to add height map game world
Terrains
Applying Terrain Cover
• Cover textures look best when created for tiling
• Use grid textures to assist with sizing and sight lines
• Paint terrain using the built-in Torque Terrain Texture Painter
Terrains
Lab 2: Terrain Cover
• Use images to create terrain cover
• Use the Terrain Texture Painter to apply terrain cover
• Add terrain cover (materials) to available selection
• Use guide images to apply cover
Summary
• Terrain = topography + cover
• Terrain characteristics: fidelity, spread, freedom
• Source data: USGS (real world), maps, onsite measurement
• Height-maps are like topographical maps
• Adjust height-maps to match game world size