Download presentation
Presentation is loading. Please wait.
1
Terrain Jyun-Ming Chen Spring 2004
2
Issues Height field (design, Perlin noise) Frustum culling
Texturing (texgen, mipmap) Transformation LOD
3
Terrain Element [i+1,j+1] [i,j+1] [i,j] [i+1,j]
4
Terrain Design Height field Convert a gray scale image to terrain
Design naturally looking terrains with Perlin noise functions
5
Frustum Culling Apply frustum culling to each terrain element to speed up rendering Verify the improved frame rates
6
Frustum Culling (terrain version)
Test center point against frustum : int SphereInFrustum (center, radius) radius = w/sqrt(2)· w:width of terrain element Quick break for terrain: No need to test top and bottom
7
Applying Textures Mipmap is very important (esp. near horizon)
Use texgen facility to generate texture coordinates procedural textures: fr08; Perlin2D
8
On Plane Equation of Texgen
[10,0,0,0] [10,0,0,0], [1,0,0,0] and [0.1,0,0,0] are different [1,0,0,0]
9
Texgen (cont) [0.1,0,0,0] From OpenGL APIDOC:
If the texture generation function is GL_OBJECT_LINEAR, the function , g = p1 * xo + p2 * yo + p3 * zo + p4 * wo is used
10
Vehicle on Terrain Determine the vehicle location [i,j]
Local y aligned with terrain normal Local x modified to its projection on terrain plane Z = X Y origin
11
Find Origin Z p2 X p0 p1
12
Level of Detail (LOD) Without LOD, the polygons are crowded near horizon
13
LOD (cont) In an ideally LOD’d scene, all polygons are roughly the same size in screen pixels.
14
ROAM (demo)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.