Chapter 9 VisibleSurface Detection Methods 2009 1 Chapter

Chapter 9. Visible-Surface Detection Methods 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 1

Classification of Visible-Surface Detection Algorithms § § object-space methods와 image-space methods가 있음 § object-space methods: object와 object의 일부분을 scene definition으로부터 비교 하여 어느 surface가 visible한지를 결정 § image-space methods: projection plane상의 pixel position으로 visibility를 결정함 sorting (depth comparison을 쉽게 함)과 coherence methods (scene 의 regularity)를 이용 하여 알고리즘의 성능 향상 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 2

Back-Face Detection § § object-space method이며 inside-outside tests를 이용 Ax + By + Cz + D < 0 이면 점(x, y, z)은 inside § N : 한 polygon surface에 대한 normal vector § V : 눈(카메라)으로부터의 viewing direction vector § V N > 0 이면 그 polygon은 back face임 § object description이 projection coordinates로 변환되고 viewing direction이 viewing zv axis와 평행하면 V = (0, 0, vz)이고, N = (A, B, C)이므로 § V N = Vz C가 됨 § normal vector N의 z component인 C의 부호에 따라 V N의 부호가 결정됨 § viewing direction이 negative zv axis 방향인 right-handed viewing system에서 § C <= 0 이면 그 polygon이 back face가 됨 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 3

Vector V in the viewing direction and a back-face normal vector N N = (A, B, C) V 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 4

A polygon surface with plane parameter C < 0 in a right-handed viewing coordinate system identified as a back face. Yv N = (A, B, C) Xv V Zv 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 5

Depth-Buffer method § § § image-space approach projection plane의 pixel position에서 surface의 depth를 비교 z-buffer method라고도 함 xv yv view plane의 (x, y)로부터 orthographic projection line상에서 surfaces의 거리를 비교함 2개의 buffer가 필요: 하나는 (x, y) position에 대한 각 surface의 depth value를 저장하 고 다른 하나는 refresh buffer로서 각 position에 대한 intensity value를 저장함 depth value의 초기치는 0 (minimum depth)이고 refresh buffer의 초기치는 background 의 intensity 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 6

At view-plane position(x, y), surface S 1 is the smallest depth from the view plane and so is visible at that position. Yv S 3 S 2 S 1 Xv (x, y) Zv 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 7

§ Depth buffer algorithm § depth buffer와 refresh buffer를 초기화 § depth(x, y) = 1. 0 /* depth values for visible surfaces */ § refresh(x, y) = Ibackgnd /* intensity values */ § 각 polygon의 pixel position에 대해 depth value (z)와 depth buffer 에 저장된 값과 비교하여 § if z < depth(x, y) 이면 depth(x, y) = z, refresh(x, y) = Isurf(x, y) § surface position (x, y)의 depth value는 plane equation 으로 부터 구해짐 -Ax – By - D § z = C 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 8


Intersection positions on successive scan lines along a left polygon edge y scan line y+1 scan line x x’ 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 10

A-Buffer Method § § § depth-buffer method의 확장 개념으로 A-buffer method는 antialiased, area-averaged, accumulation-buffer method를 나타냄 depth-buffer method의 단점: 각 pixel position에 대해 one visible surface만 찾을 수 있 다는 것, 즉 불투명한 표면만 처리할 수 있어서 여러 면의 intensity values를 축적시 켜서 투명한 면을 표현하지 못한다. A-buffer method § depth-buffer를 확장시켜서 buffer 내 각 position이 a linked list of surfaces를 참조 할 수 있도록 함 § A-buffer내 각 position은 depth field와 intensity field를 가짐 § depth field: a positive or negative real number 저장 § intensity field: surface-intensity information혹은 pointer value 저장 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 11

§ § depth field가 양수이면 a single surface의 depth를 나타내고, intensity field는 surface color의 RGB 값을 저장 depth field가 음수이면 pixel intensity를 위한 multiple-surface contributions를 의미하 며 intensity field는 surface data의 linked list의 포인터를 저장, 각 surface를 위한 데이 터로는 § RGB intensity components § Opacity parameter § Depth § Percent of area coverage § Surface identifier § Other surface-rendering parameters § Pointer to next surface 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 12

Scan-line method § § § image-space method polygon 내부를 채우는 scan-line algorithm을 확장 § scan line을 진행하면서 scan line과 교차하는 모든 polygon surface가 visible한지 를 조사한다. § 각 scan line에 대해 겹치는 모든 surface의 depth를 계산하여 view plane에 가장 가까운 면을 찾아 그 면의 intensity value를 refresh buffer에 넣는다. edge table 및 polygon table을 포함해서 면들을 위한 여러 tables 이 준비되어 있다고 가정 § edge table은 각 line의 끝 점들, 기울기, polygon table의 포인터 등을 포함하며, § polygon table은 각 면의 평면 방정식, 면에 대한 intensity 정보, edge table에 대한 포인터 등을 포함 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 13

Scan lines crossing the projection of two surfaces, S 1 and S 2, in the view plane. Yv B E F A Scan Line 1 S 2 S 1 H D Scan Line 2 Scan Line 3 C G Xv 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 14



depth-sorting method § § image-space and object-space operation을 이용 § surface들을 decreasing depth로 sort § surface들을 가장 큰 depth를 갖는 surface부터 시작하여 scan conversion painter’s algorithm이라고도 함 – oil painting시에 background color를 먼저 칠한 뒤에 먼 거리의 물체를 칠한 뒤에 가까운 거리에 있는 물체를 칠하고 마지막으로 가장 앞 에 있는 물체를 그리는 것과 비슷함 § surfaces를 view plane으로부터의 거리로 sort하여 가장 먼 거리에 있는 surface의 intensity value를 refresh buffer에 넣는다. § Decreasing depth순서대로 차례로 surface의 intensity를 frame buffer에 더해나간 다. 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 17

§ depth-sorting method § surface들을 z value로 sort하여 가장 큰 depth와 리스트 내 다른 surface들과 비교 하여 depth overlap이 없으면 scan conversion을 계속한다. § Depth overlap이 발견되면 surface들의 순서를 조정하기 위해 추가적인 비교가 필요 i) 두 surfaces의 xy plane에서의 bounding rectangles이 overlap 하지 않는지를 테 스트 ii) surface S 가 viewing position에 비교해 overlapping surface에 completely behind인지를 테스트 iii) overlapping surface가 S에 completely front에 있는지 테스트 iv) 두 surfaces의 view plane로의 projection이 overlap 하는지 테스트 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 18

S S S S’ S’ S’ xmin xmax xmin’ xmax’ (Fig. 9 -14) Surface S is completely (Fig. 9 -13) Two surfaces with depth behind the overlapping overlap but no overlap surface S’. in the x direction. 2009 -1학기 (Fig. 9 -15) Overlapping surface S’ is completely in front of surface S. Chapter 9. Visible-Surface Detection Methods 19


BSP-Tree Method (Binary Space Partitioning Tree) § § painter’s algorithm에서와 같이 surfaces를 back부터 front까지 칠해나가는 방법으로 object visibility를 결정 view reference point는 변하나 scene내 물체는 고정 위치에 있는 경우에 유용. viewing direction에 대한 각 space subdivision단계에서 surfaces가 space 를 분할하는 평면에 대해 inside인지 outside인지를 판별하는 과정이 필요 (그림 9 -19)에서 § 먼저 plane P 1으로 공간을 분할하여 viewing direction에 따라 물체들이 back 혹 은 front로 나눈다. 한 물체가 평면과 교차되는 경우엔 그 물체를 두개 별도 물체 로 분리한다. § A, C는 P 1의 front에 있고, B, D는 P 1의 back에 있음 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 21

A region of space (a) is partitioned with two planes P 1 and P 2 to form the BSP tree representation in (b) P 2 C P 1 front back D P 2 A P 2 front back front back B front (a) 2009 -1학기 A C B D (b) Chapter 9. Visible-Surface Detection Methods 22

§ 다시 plane P 2로 공간을 분할하여 binary tree 를 구성하여 모든 물체들이 terminal nodes로 표시되도록한다. Front objects는 왼쪽 노드에 back objects는 오른쪽 노 드로 한다. § BSP Tree가 완성되면 surfaces를 back에서 front의 순서로 칠해나간다. 즉 background objects를 칠한 뒤에 foreground objects를 칠함 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 23

Area-Subdivision Method § § § image-space method이나 surface의 depth ordering을 위해 object-space operation을 이 용 scene의 area coherence 성질을 이용 total viewing area를 점점 작은 사각형으로 분할해나가서 각 작은 사각형 하나가 a single visible surface가 투영되었거나 혹은 투영된 surface가 없는 경우가 되도록 한 다 지정된 area에 대한 a single surface의 visibility 결정은 surface와 area boundary를 비교 하는 테스트로 이루어진다. surface와 area boundary와 관계 § surrounding surface § overlapping surface § inside surface § outside surface 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 24

Dividing a square area into equal-sized quadrants at each step 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 25

Possible relationships between polygon surfaces and a rectangular area Surrounding surface 2009 -1학기 Overlapping surface Inside surface Chapter 9. Visible-Surface Detection Methods Ouside surface 26

§ area에 대한 surface visibility 테스트: 다음의 조건 중 하나가 true이면 subdisivion을 더 이상 하지않는다. § area에 대한 모든 surfaces가 outside 에 있는 경우 § only one inside, overlapping, or surrounding surface 만 area에 있는 경우 § a surrounding surface가 area boundary내에서 다른 모든 surfaces를 가리는 경우 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 27

Octree Methods § § viewing volume에 octree를 이용하는 경우에는 octree node를 front-to-back order로 viewing surface에 투영시켜서 hidden-surface elimination을 실행함 § back octants (4, 5, 6, 7)은 front octants에 의해 가려지므로 back surfaces는 제거함 § 마찬가지로 octant 0의 4개 front suboctants를 처리해간다. § 계속하여 각 octant에 위의 처리를 계속해간다. § an octree node가 a color value로 나타나면 이 노드에 해당하는 frame buffer내 pixel area에 그 color value를 지정한다. octree를 display하는 방법은 octree nodes를 front에서 back으로 recursive하게 조사해 서 보이는 영역의 octree를 quadtree로 매핑시킨 후, quadtree 표현을 frame buffer에 load 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 28

Objects in octants 0, 1, 2, and 3 obscure objects in the back octants (4, 5, 6, 7) 6 5 4 1 0 3 7 2 Numbered octants of a region 2009 -1학기 Viewing direction Chapter 9. Visible-Surface Detection Methods 29

Ray-Casting Method § § § view plane의 a pixel position에서 물체를 통과하는 광선과 surface의 교차점 중 가장 가까이에 있는 교차점으로 surface의 visibility를 정하는 방법 ray casting procedure 이용 § 광선의 경로를 추적하는 geometric optic method curved surfaces로 표현된 scene의 visibility detection에 효과적이다. ray casting은 multiple ray paths를 추적하여 multiple objects로부터 반사와 굴절을 취 하는 ray tracing algorithm의 특별한 경우이다. ray casting에서는 각 픽셀로부터 가장 가까운 물체로의 하나의 광선을 따른다. 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 30

Curved Surfaces § § § 곡면으로 구성된 물체의 visibility 를 결정하는 효과적 방법으로 ray-casting 과 octree 방법이 있음 § ray-casting: ray-surface intersection을 계산해야 하고 pixel ray를 따라 가장 작은 교차 거리를 정한다. § Octree: 물체에 대한 입력이 정의되면 모든 visible surface들은 같은 방법으로 구 해질 수 있음 curved surface를 plane polygon 들로 정의하는 경우엔 각 curved surface를 polygon mesh로 바꾸고 앞에서의 hidden-surface methods를 사용 Curved surface representations § Implicit equation인 f(x, y, z) = 0 혹은 parametric representation 사용 § 때로는 explicit equation 사용이 편리한 경우가 있다. Xy ground plane에 대한 높 이 함수로 다음의 식 사용 § z = f(x, y) 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 31



Wireframe methods § § § 물체의 outline만 디스플레이 할 때는 visibility test가 surface edges에 적용되어, visible edge sections은 디스플레이되고 hidden edge sections은 제거되거나 visible edges와는 다르게 디스플레이되도록 한다. object edges의 visibility 를 결정하는 프로시듀어를 wireframe visibility 라고 함. Visible line detection methods 혹은 hidden-line detection methods라고도 함. visible line을 구분하기 위한 직접적인 방법은 각 line을 각 surface와 비교하는 것 § 이 방법은 arbitrary window shapes에 대한 line clipping 와 유사. § 일부 line은 surface에 가려짐 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 34

§ 각 line에 대해 어느 line section이 보이지 않는가를 결정하기 위해 surface와 depth values를 비교: 각 coordinate position을 테스트하지 않고 hidden line segments를 결정하기 위해 coherence methods 사용 가능 § surface boundary의 projection과의 양쪽 line intersection이 surface보다 depth 가 큰 경우는 line segment가 completely hidden (그림 9 -28 a). § line이 한 boundary intersection에서는 depth가 크고, 다른 boundary intersection에서는 depth가 작은 경우에는 line이 surface 내부를 관통함(그림 9 -28 b). 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 35

Hidden-line sections (dashed) for a line that (a) passes behind a surface and (b) penetrates a surface (a) 2009 -1학기 (b) Chapter 9. Visible-Surface Detection Methods 36

Wireframe Depth-Cueing Algorithm § § Visibility information 을 디스플레이하는 또 다른 방법 물체의 밝기를 viewing position 으로부터의 거리의 함수로 나타냄 fdepth (d) = dmax - dmin d: viewing position 으로부터의 거리 dmin, dmax: minimum and maximum depth 혹은 normalized depth range (dmin = 0. 0, dmax = 1. 0) § § 각 픽셀의 위치가 처리될 때 픽셀 컬러에 fdepth (d)가 곱해진다. 가까운 점에 보다 큰 강도(intensity)가 주어지고, 최대 깊이에는 강도가 0 값을 갖는 다. 2009 -1학기 Chapter 9. Visible-Surface Detection Methods 37

2009 -1학기 Chapter 9. Visible-Surface Detection Methods 38
- Slides: 38