19
Hierarchical Z-Buffer Occlusion Culling – Generating Occlusion Volumes Author : Nick Darnell ncsoft 이이이 http://cafe.naver.com/shader

Hierarchical z buffer occlusion culling

Embed Size (px)

Citation preview

Page 1: Hierarchical z buffer occlusion culling

http://cafe.naver.com/shader

Hierarchical Z-Buffer Occlusion Culling

– Generating Occlusion Volumes

Author : Nick Darnellncsoft 이재윤

Page 2: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Goal

Page 3: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

By 가내수공업 !

Page 4: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

Page 5: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

어떻게 ?

Page 6: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

Page 7: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

Bounding mesh 의 가장 가까운 점과 depth buffer 의 값을 비교

Page 8: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

About the HZB-OC

Occluder 를 만들

Auto generating system

이 필요함

Page 9: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Overview

1. Find all the voxels inside a mesh

2. Find the densest voxel in the volume

3. Expand a box from 2 until collide with sur-

face

4. Repeat 2-3 until some terminal condition

5. Filter small/useless box

6. Use a CSG to merge the created boxes

Page 10: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Focus on

• Conservativeness– Occluder 가 mesh 의 surface 를 넘어가면 안됨

• Simplicity– 당연하게도 , Occluder mesh 는 적은 triangle 로 구성

• Volume conservation– 간단한 모양이지만 , original mesh 와 비슷해야 함

• Dynamic– 게임에는 움직이는 커다란 occluders 혹은 파괴 가능한

wall 이 존재

Page 11: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 1: Voxelization

• [Schwarz 2010] 참고 1)

• Solid / Surface voxelization

• Overlap test

– Condition

1) T 를 포함한 평면이 B 와 overlap

2) xy, yz, xz 평면에 proj. 한 T 와 B 가 overlap

1) Fast Parallel Surface and Solid Voxelization on GPUs

T

V0

V1 V2

B

P

P+dP

n

Page 12: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 1: Voxelization

• For the condition 1)

• n : T’s normal, c : critical point

and check below

Page 13: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 1: Voxelization

• For the condition 2)– Utilize edge functions [Pineda 1988]

Page 14: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 2: Find the highest density voxel

• 다음 step 인 box expansion 과 iteration

하며– Mesh 의 가장 내부에 있는 point 를 계산

– Empty voxel 도 검색• Empty voxel : Box expansion 시 box 에 의해 enclosed

된 voxel

Page 15: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 3:Box expansion

• 이전 step 에서 찾은 densest voxel 의 위치에 13 크기의 box 생성

• Iterative 하게 각 방향으로 box 확장

• AAB 는 Non-right angle model 에 최적화되지 않음 -> OBB 로의 가능성

Page 16: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 4:Repeat step 2-3

• 종료 조건– Mesh volume 이 정해진 % 이하로 남았을 때

– 마지막으로 생성한 box 가 확장된 크기가 전체 volume

에 비해 정해진 % 이하일 때

– 최대 box 개수를 미리 설정

– 등등 ..

Page 17: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 5:Filter boxes

• 자기는 안 썼지만 쓰면 좋을 수도 있다는 ..

• 사용한 Stopping condition 에 따라 다양하게 적용 가능– Condition 엔 부합하지만 너무 작은 box 들을 제거

– 등등 ..

Page 18: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Step 6:Merge boxes with CSG

• Constructive Solid Geometry

• Real-time CSG in Game Development

Tools.

Union Difference Intersec-tion

Page 19: Hierarchical z buffer occlusion culling

|

http://cafe.naver.com/shader

Results