terrain
DESCRIPTION
Terrain. 2001.11.27 김 성 남. Contents. Terrain Rendering Overview What is DEM? Lindstrom’s Algorithm Block-Based Simplification Vertex-Based Simplification Vertex Dependencies Other Issues Memory Menagement Summary. Overview(1/3). 응용분야 Flight Simulator Multi player 3D network game. - PowerPoint PPT PresentationTRANSCRIPT
11 Korea UniversityGraphics Laboratory
TerrainTerrain
2001.11.272001.11.27
김 성 남김 성 남
Graphics Laboratory
Korea University22
ContentsContents
• Terrain Rendering Overview• What is DEM?• Lindstrom’s Algorithm
– Block-Based Simplification
– Vertex-Based Simplification
– Vertex Dependencies
• Other Issues– Memory Menagement
• Summary
Graphics Laboratory
Korea University33
Overview(1/3)Overview(1/3)
• 응용분야– Flight Simulator
– Multi player 3D network game
Tribes(Lindstrom algorithm)Prince of Darkness(PM of Hoppe)
Graphics Laboratory
Korea University44
Overview(2/3)Overview(2/3)
• Terrain Data representation– TIN(Triangulated Irregular Network)
– DEM(Digital Elevation Model) or Height Field
TIN(x,y,z) DEM(x,y,h(x,y))
Graphics Laboratory
Korea University55
Overview(3/3)Overview(3/3)
• DEM vs. TIN
DEM TIN
저장 간단 저장 복잡
위성 데이터로부터 쉽게 획득 별도의 데이터 생성과정 요구
지형의 특성과 무관하게 vertex의 개수가 정해짐
지형의 특성에 따라 vertex 의 개수가 달라짐
Graphics Laboratory
Korea University66
What is DEM?What is DEM?
• Height Field– 높이 값만을 저장하고 있는 2 차원 배열– 배열의 Index 가 x, y 좌표로 사용– LOD 적용 용이
x y
z
18
20 15
30
25
10
15
7
15
71518
151020
253015
Graphics Laboratory
Korea University77
Lindstrom’s AlgorithmLindstrom’s Algorithm• Bottom-up LOD
– Block-Based Simplification
– Vertex-Based Simplification
– Vertex Dependencies
Graphics Laboratory
Korea University88
QuadtreeQuadtree
• DEM Quadtree– 3 X 3 vertex 들로 이루어진 영역 : Block
– Level K block 은 level K+1 의 4 개 Block 을 자식으로 가짐
Level 1 Level 2 Level 3
Resolution
Level
low
high
high
low
Graphics Laboratory
Korea University99
Vertex-Based SimplificationVertex-Based Simplification
• 제거 후보 vertex– Corner vetex 를 제외한 block 내 5 개의 vertex
• 불필요한 vertex 제거– 한 쌍 (triangle, co-triangle) 이 하나로 합쳐짐 : base vertex
제거
– Recursively !!
Base vertex
(Triangle, co-triangle) pair
Graphics Laboratory
Korea University1010
Error Metric(1/5)Error Metric(1/5)
• vertex 간략화 ( 제거 ) 기준– vertex 간략화를 통해 발생한 error 가 어떤 임계치 τ 보다
작으면 vertex 제거
xy
z
A
B
C
E
2zz
zB
CAB
Graphics Laboratory
Korea University1111
Error Metric(2/5)Error Metric(2/5)
• δ 선분의 중점 v 가 눈 좌표계의 z 축 상에 있다고가정
200
vv
200
vv
A B
C
E v+
v-
v Projection plane
x
Eye coordinates
z
y
e(view point)d
Graphics Laboratory
Korea University1212
Error Metric(3/5)Error Metric(3/5)
• View matrix
1
0
0
0
ve
veeyexe
ve
veyx
ve
veyx
ve
veyx
Mzz
zz
yyyy
xxxx
MvMvvv eyeeye
0ve
veyx zzzz
222
1
ve
veyx zzzz
Graphics Laboratory
Korea University1313
Error Metric(4/5)Error Metric(4/5)
• Screen 에서 계산된 δ
screenscreenscreen vv
z
yyxx
eye
eyeeyeeyeeye
v
vvvvd
22
ve
yxd zz
22
222
22
2
1
zzyyxx
yyxx
zz
veveve
veved
ve
veve
d
λ : world coordinates 단위 길이가 screen 에서 차지하는 pixel 수
Graphics Laboratory
Korea University1414
Error Metric(5/5)Error Metric(5/5)
• δscreen 을 τ 와 비교• 속도 향상을 위해 제곱값 비교
22222
22222
zzyyxx
yyxx
veveve
veved
Graphics Laboratory
Korea University1515
Block-Based Simplification(1/2)Block-Based Simplification(1/2)
• 모든 vertex 에 대해 δscreen 을 계산– DEM 간략화를 수행하면 계산량이 방대해짐
• Block 내의 5 개의 vertex 를 한번에 제거 가능여부 검사• 인접한 4 개 block 이 블록 간략화가 된다면 higher level 로
이전
Graphics Laboratory
Korea University1616
Block-Based Simplification(2/2)Block-Based Simplification(2/2)
• Block 내에서 world coordintes 의 δmax 값을 미리 계산
• “δmax<= δ0 가 성립하면 해당 block 의 모든 제거 후보 vertex 의 δ 값 투영치가 임계치 τ ” 보다 작음이 보장 되는 δ0 계산
• 인접한 4 개 block 이 블록 간략화되면 higher level(low resolution)로 이전
• 이러한 과정은 재귀적 (recursive) 으로 수행
Graphics Laboratory
Korea University1717
CrackCrack
• Quadtree 의 인접영역에서 vertex 불일치 발생
Crack 생성
Block 간략화 결과 Vertex 간략화 결과
crack
Graphics Laboratory
Korea University1818
Vertex Dependencies(1/3)Vertex Dependencies(1/3)
• 두개의 직각 이등변 삼각형이 합쳐져 하나의 이등변 삼각형 구성• 두개의 직각 이등변 삼각형의 base vertex 가 삭제되면서 두 삼각형의 shar
ed edge 가 제거
• 반대로 , Base vertex 가 mesh 에 삽입되기 위해서는 shared edge, apex vertex 가 반드시 필요
Base vertex
Graphics Laboratory
Korea University1919
Vertex Dependencies(2/3)Vertex Dependencies(2/3)
• Vertex dependencies
• 어떤 vertex 가 제거되지 않는다고 결정되면 , 그 vertex 가 종속되는 vertex 가 반드시 존재
는 에 종속 ( depend on )
Graphics Laboratory
Korea University2020
Vertex Dependencies(3/3)Vertex Dependencies(3/3)
• Forced split– Vertex dependencies 를 이용한 crack 제거
– Refinement 될 필요가 없는 추가적인 triangles 생성
Graphics Laboratory
Korea University2121
Block RenderingBlock Rendering
• Binary tree 개념을 이용한 rendering• Triangle strip 을 이용한 rendering
Graphics Laboratory
Korea University2222
Other IssuesOther Issues
• Terrain Pages– To minimize memory usage, apply unsigned short type for
height and queue indices– 광대한 지형을 한꺼번에 memory 에 load 할 수 없으므로 ,
효율적으로 memory 에 load, computation 할 수 있는 적당한 크기의 Terrain pages 생성
– View 이동에 따라 page in and out, crack 방지 • Memory Management
– Height field 를 제외하고 , 가능한 한 많은 부분 (texture coordinates , etc) 을 pages 간에 공유
– 현재 지형 모델에서 가장 많이 연구되고 있는 분야
Graphics Laboratory
Korea University2323
Lindstrom DemoLindstrom Demo
Peter Lindstrom et al., “Real-Time, Continuous Level of Detail Rendering of Height Field”,SIGGRAPH96
Graphics Laboratory
Korea University2424
SummarySummary
• DEM(Digital Elevation Model)• Lindstrom’s Algorithm(Bottom-up LOD)
– Block-Based Simplification
– Vertex-Based Simplification
– Vertex Dependencies(No crack and Forced Split)
• Memory Management