Docsity

Terrain Generation: 2D Tiles, Heightmaps, and Terrain Meshes - Prof. John E. Laird, Study notes of Electrical and Electronics Engineering

Partial preview of the text

Download Terrain Generation: 2D Tiles, Heightmaps, and Terrain Meshes - Prof. John E. Laird and more Study notes Electrical and Electronics Engineering in PDF only on Docsity!

EECS 494: Terr

John UmJohn Um Nicholas

Updated Nove

Mt

Rainier created by M

Mt. Rainier, created by M

r

ain Generation mbaughmbaugh^ s

Gorski

mber 9, 2007 Manel Giuli with TerragenManel Giuli with Terragen

Outline (1 of 2)

●

Possible data representatio

−

Tiles

−

Heightmaps

−

Terrain Meshes

−

Mini case-study: Chips

●

Autogeneration

−

Fault Formation

−

Midpoint Displacement

−

Particle Deposition

−

Other methods

ns

2D Representation: Tile

●

Pretty simple; you have a segrid

Each grid in the squar

grid. Each grid in the squar

−

Square grid45º view square grid (sa

−

-view square grid (sa

−

Hexagonal “grid”

e

s - 1

e

t of tiles and a regularly-spaced

re is occupied by a tilere is occupied by a tile. ame as the square grid)ame as the square grid)

2D Representation: Tile

●

The tile-based approach is sfrom ugliness because the tfrom ugliness because the ttoo harsh.

●

Many games employ a techMany

games employ a tech

Michael (

http://www.gamedev.net/

Samu Games (

http://www.samu

between tilesbetween tiles.

●

Rather than have lots and lotransitions, Michael impleme

p

transparency approach.

e

s - 2 s

imple, but it potentially suffers

transitions between tiles is muchtransitions between tiles is much hnique described by Davidhnique described by David

/reference/articles/article934.asp

) of

ugames.com/

): blend transitions

ots of tiles to implementented a precendence-and-

p

2D Representation: Tile

●

16 possible edge tran

t

iti

corner transitions.

●

We can combine thecorner transitions to cpossible transitions.

●

A

bove are the transit

Top are edge transiti

−

Top

are edge transiti

−

Bottom are corner tra

−

Black areas are trans

e

s - 4

n

sitions, and 16 possible

edge transitions with the

g

create all 256 (???)tion templates.onsons

ansitionssparent; grey are opaque

2D Representation: Tile

●

A

n artist uses these

32 (30) terrain transit32 (30) terrain transit

●

Many more extra tilemoremore.

e

s - 5 transitions to create thetions – for each tile type.tions

for each tile type.

s, but not exponentially

2D Representation: Tile

●

Good results. Here's

e

s - 7

s

a before and after:

Heightmaps - 1

●

Essentially a 2D arraN

ll

i

th

●

N

ormally in the range

●

Black pixels are the l

p

highest

●

Generally we use a

●

Generally, we use a Photoshop, plasma inor some such techniqor some such techniqsmooth) imageWe translate each po

●

We

translate each po

of the corresponding

a

y of pixels

e 0-

owest; light pixels the

g

p

clouds filter inclouds

filter in

in the Gimp, Perlin Noise

que to create a noisy (butque to create a noisy (butoint in a grid by a factoroint in a grid by a factor

g pixel in the image

Heightmap limitations

●

What kind of terrain formations simple heightmap?simple

heightmap?

s

can we

not represent with a

Heightmap limitations

●

What kind of terrain formations simple heightmap?simple

heightmap?

Also overhangs

“Devil's Towe

Also overhangs,

Devil s Towe

s can we

not represent with a

er

” type landforms etc

er -type landforms, etc.

Terrain Meshes Can you spot the potential probleCan

you spot the potential proble

m? (hint: think of jagged terrains)m? (hint: think of jagged terrains)

Terrain Meshes -- Quads How should we triangulate this quHow

should we triangulate this qu

s

uad?uad?

Terrain Meshes

Delaunay Triangulation

●

We want to figure out a way toand triangles in our terrain mesand triangles in our terrain mesnumber of very thin

“sliver”

tria

can render the same scene wit

●

This is where Delaunay Triang

●

Intuitively, Delaunay Triangulattriangulates them.

●

http://www.cs.cornell.edu/Info/P

reduce the number of vertices sh

We also want to reduce the

sh. We also want to reduce the

ngles in our mesh; probably we th fewer, larger triangles.

ulation becomes useful.tion takes a set of points and People/chew/Delaunay.html