Hierarchical Z-Buffer Occlusion Culling
    – Generating Occlusion Volumes

                                Author : Nick Darnell
                                       ncsoft 이재윤




              http://cafe.naver.com/shader
| Goal




         http://cafe.naver.com/shader
| About the HZB-OC




              By 가내수공
              업!




           http://cafe.naver.com/shader
| About the HZB-OC




           http://cafe.naver.com/shader
| About the HZB-OC




           어떻게?




           http://cafe.naver.com/shader
| About the HZB-OC




           http://cafe.naver.com/shader
| About the HZB-OC




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


                http://cafe.naver.com/shader
| About the HZB-OC


       Occluder를 만들

    Auto generating system

           이 필요함


           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 surface

4. Repeat 2-3 until some terminal condition

5. Filter small/useless box

6. Use a CSG to merge the created boxes

                   http://cafe.naver.com/shader
| Focus on
• Conservativeness
  – Occluder가 mesh의 surface를 넘어가면 안됨
• Simplicity
  – 당연하게도, Occluder mesh는 적은 triangle로 구성
• Volume conservation
  – 간단한 모양이지만, original mesh 와 비슷해야 함
• Dynamic
  – 게임에는 움직이는 커다란 occluders 혹은 파괴 가능한
    wall이 존재


                http://cafe.naver.com/shader
Step 1:
| Voxelization
• [Schwarz 2010] 참고1)

• Solid / Surface voxelization                                            n
                                                           P+dP    V0
• Overlap test
                                                       B           T
  – Condition                                                 V1          V2
                                             P
     1) T를 포함한 평면이 B와 overlap

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


                1) Fast Parallel Surface and Solid Voxelization on GPUs
                        http://cafe.naver.com/shader
Step 1:
| Voxelization
• For the condition 1)




     • n : T’s normal, c : critical point
  and check below




                          http://cafe.naver.com/shader
Step 1:
| Voxelization
• For the condition 2)
  – Utilize edge functions [Pineda 1988]




                     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




                    http://cafe.naver.com/shader
Step 3:
| Box expansion
• 이전 step에서 찾은 densest voxel의 위치에 13 크
 기의 box 생성

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

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



              http://cafe.naver.com/shader
Step 4:
| Repeat step 2-3
• 종료 조건
 – Mesh volume이 정해진 % 이하로 남았을 때

 – 마지막으로 생성한 box가 확장된 크기가 전체 volume
   에 비해 정해진 % 이하일 때

 – 최대 box 개수를 미리 설정

 – 등등..



             http://cafe.naver.com/shader
Step 5:
| Filter boxes
• 자기는 안 썼지만 쓰면 좋을 수도 있다는..

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

  – 등등..




                 http://cafe.naver.com/shader
Step 6:
| Merge boxes with CSG
• Constructive Solid Geometry




       Union          Difference                 Intersection



• Real-time CSG in Game Development Tools.

                  http://cafe.naver.com/shader
| Results




            http://cafe.naver.com/shader

Hierarchical z buffer occlusion culling

  • 1.
    Hierarchical Z-Buffer OcclusionCulling – Generating Occlusion Volumes Author : Nick Darnell ncsoft 이재윤 http://cafe.naver.com/shader
  • 2.
    | Goal http://cafe.naver.com/shader
  • 3.
    | About theHZB-OC By 가내수공 업! http://cafe.naver.com/shader
  • 4.
    | About theHZB-OC http://cafe.naver.com/shader
  • 5.
    | About theHZB-OC 어떻게? http://cafe.naver.com/shader
  • 6.
    | About theHZB-OC http://cafe.naver.com/shader
  • 7.
    | About theHZB-OC Bounding mesh의 가장 가까운 점과 depth buffer 의 값을 비교 http://cafe.naver.com/shader
  • 8.
    | About theHZB-OC Occluder를 만들 Auto generating system 이 필요함 http://cafe.naver.com/shader
  • 9.
    | Overview 1. Findall the voxels inside a mesh 2. Find the densest voxel in the volume 3. Expand a box from 2 until collide with surface 4. Repeat 2-3 until some terminal condition 5. Filter small/useless box 6. Use a CSG to merge the created boxes http://cafe.naver.com/shader
  • 10.
    | Focus on •Conservativeness – Occluder가 mesh의 surface를 넘어가면 안됨 • Simplicity – 당연하게도, Occluder mesh는 적은 triangle로 구성 • Volume conservation – 간단한 모양이지만, original mesh 와 비슷해야 함 • Dynamic – 게임에는 움직이는 커다란 occluders 혹은 파괴 가능한 wall이 존재 http://cafe.naver.com/shader
  • 11.
    Step 1: | Voxelization •[Schwarz 2010] 참고1) • Solid / Surface voxelization n P+dP V0 • Overlap test B T – Condition V1 V2 P 1) T를 포함한 평면이 B와 overlap 2) xy, yz, xz 평면에 proj. 한 T와 B가 overlap 1) Fast Parallel Surface and Solid Voxelization on GPUs http://cafe.naver.com/shader
  • 12.
    Step 1: | Voxelization •For the condition 1) • n : T’s normal, c : critical point and check below http://cafe.naver.com/shader
  • 13.
    Step 1: | Voxelization •For the condition 2) – Utilize edge functions [Pineda 1988] http://cafe.naver.com/shader
  • 14.
    Step 2: | Findthe highest density voxel • 다음 step인 box expansion과 iteration 하며 – Mesh의 가장 내부에 있는 point 를 계산 – Empty voxel도 검색 • Empty voxel : Box expansion시 box에 의해 enclosed된 voxel http://cafe.naver.com/shader
  • 15.
    Step 3: | Boxexpansion • 이전 step에서 찾은 densest voxel의 위치에 13 크 기의 box 생성 • Iterative 하게 각 방향으로 box 확장 • AAB는 Non-right angle model에 최적화되지 않 음 -> OBB로의 가능성 http://cafe.naver.com/shader
  • 16.
    Step 4: | Repeatstep 2-3 • 종료 조건 – Mesh volume이 정해진 % 이하로 남았을 때 – 마지막으로 생성한 box가 확장된 크기가 전체 volume 에 비해 정해진 % 이하일 때 – 최대 box 개수를 미리 설정 – 등등.. http://cafe.naver.com/shader
  • 17.
    Step 5: | Filterboxes • 자기는 안 썼지만 쓰면 좋을 수도 있다는.. • 사용한 Stopping condition에 따라 다양하게 적용 가능 – Condition엔 부합하지만 너무 작은 box 들을 제거 – 등등.. http://cafe.naver.com/shader
  • 18.
    Step 6: | Mergeboxes with CSG • Constructive Solid Geometry Union Difference Intersection • Real-time CSG in Game Development Tools. http://cafe.naver.com/shader
  • 19.
    | Results http://cafe.naver.com/shader