3D Game Programming All in One

14
3D Game Programming All in One By Kenneth C. Finney

description

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 - PowerPoint PPT Presentation

Transcript of 3D Game Programming All in One

Page 3: 3D Game Programming All in One

Terrains

• For outdoor game environments

• Terrain is a topography model combined with ground cover textures

Page 4: 3D Game Programming All in One

Terrains

Terrains Explained– Tiles are the basic terrain unit– Terrain tiles are a collection of

polygons, like any other 3D model

Page 5: 3D Game Programming All in One

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

Page 6: 3D Game Programming All in One

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)

Page 7: 3D Game Programming All in One

Terrains

Terrain Modeling

• External modeling method: terrain as another object in the game world

• Internal method: game engine contains specialized terrain rendering code

Page 8: 3D Game Programming All in One

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)

Page 9: 3D Game Programming All in One

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

Page 10: 3D Game Programming All in One

Terrains

Tiling

• Issues similar to those found in structure textures– seamless transitions– appropriate lighting

Page 11: 3D Game Programming All in One

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

Page 12: 3D Game Programming All in One

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

Page 13: 3D Game Programming All in One

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

Page 14: 3D Game Programming All in One

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