다해상도 지연 렌더링

20
다 다다다 다다 다다다 Multi-Resolution Deferred Shading Game Programming Gems 8 http:// cafe.naver.com/shader

Upload: jaeyun-lee

Post on 25-May-2015

1.206 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 다해상도 지연 렌더링

다 해상도 지연 셰이딩Multi-Resolution Deferred Shading

Game Programming Gems 8

http://cafe.naver.com/shader

Page 2: 다해상도 지연 렌더링

| 개요

• 기존의 deferred shading 에 적응적 부분 표준화 (adaptive sub-sampling) 를 적용– Adaptive Sub-sampling :

넓은 영역은 큰 붓 , 좁은 영역은 작은 붓

• 눈에 띄는 손해 없이 PS 의 cost 절감

Page 3: 다해상도 지연 렌더링

| 발전과정

Deferred Shading

Light Pre-pass render-

ing

Inferred Lighting

Page 4: 다해상도 지연 렌더링

• 렌더링에 필요한 정보를 G-Buffer 에 저장– Depth, normal, 반사율 (reflecxibility) 등

–Memory 와 Cost 의 trade-off

• 최종 렌더링을 Per-pixel 처리로 대체– Lighting Cost 와 scene complexity 가

무관

Deferred Shading

Light Pre-pass render-

ing

Inferred Lighting

Page 5: 다해상도 지연 렌더링

• Material 정보를 G-Buf 에 저장하지 않음

• 최종 합성 전 light-pass 를 두고 L-buffer 에

lighting 처리 정보만을 따로 저장

• Obj 를 다시 그리면서 (2nd pass) 고유 mate-

rial 정보와 L-buffer 정보를 합성

• H/W anti-aliasing 지원

Deferred Shading

Light Pre-pass render-

ing

Inferred Lighting

Page 6: 다해상도 지연 렌더링

• G-buf, L-buf 를 저해상도로 생성 ( 대역폭 향상 )

• Up-sampling 시 Discontinuity 를 해결하기 위해 depth, Obj ID 를 이용해서 경계선을 필터링 (DSF 필터링 )

• 투명한 오브젝트 처리 가능

Deferred Shading

Light Pre-pass render-

ing

Inferred Lighting

Page 7: 다해상도 지연 렌더링

|Multi-resolution Deferred Shading

• 모든 픽셀에 대해 lighting 을 계산하는 de-

ferred shading 을 개선

• 비슷한 영역은 저해상도에서 처리 후 보간하여 고해상도 버퍼에 적용

Page 8: 다해상도 지연 렌더링

|Process

• Geometry pass

• Multi-resolution rendering pass

• Composite pass

Page 9: 다해상도 지연 렌더링

|Geometry pass

• Deferred shading 과 같이 G-buf 를 채움–어떤 G-buf 구성도 호환

Page 10: 다해상도 지연 렌더링

|Multi-resolution rendering pass

• Resolution selection

• Shading

• Interpolation

Page 11: 다해상도 지연 렌더링

|Multi-resolution rendering pass

• 3 개의 R-buffer 사용–전체 해상도 , 1/4 해상도 , 1/16 해상도

• Early-Z culling 사용–픽셀단위 culling, 2-pass 기법 (depth 먼저 )

Page 12: 다해상도 지연 렌더링

|Multi-resolution rendering pass

1. 저해상도 R-buf 에 depth 를 1 로 채움 (z-test : LessEqual)

2. 버퍼를 렌더링할 직사각형 메시의 Z 좌표를

Zi = 0.1 – i * 0.1 (i : 현재 버퍼의 index) 로 지정

3. 공간 근접도 (spatial proximity) 비교하여 depth 를 저장

* spatial proximity

: 주변 픽셀과의 material ID, depth,

normal 등을 비교 (threshold 사용 ) 하여 측정

Page 13: 다해상도 지연 렌더링

|Multi-resolution rendering pass

3. 공간 근접도가 일정 threshold 를 넘으면 depth 를 기록하지 않고 기존의 depth 를 남겨 상위 해상도에서 기록하도록 유도

4. z-test 를 equal 로 변경 후 lighting 값을 R-

buf 에 적용

Page 14: 다해상도 지연 렌더링

|Multi-resolution rendering pass

5. R-buf 를 위 단계 해상도 버퍼로 복사

- Bilinear / Bi-cubic 필터링 적용

6. 위의 1 – 5 과정을 해상도를 올려가며 반복

-> 화면의 각 픽셀이 적합한 해상도의 R-buf

로 shading 됨

Page 15: 다해상도 지연 렌더링

|Multi-resolution rendering pass

BUT!

• Lighting, shadow 에 artifact 가능성 존재

• Lighting 시 빛을 받는 픽셀은 1, 그 외에는 0

을 알파채널에 저장

–알파 값이 다른 부분은 상위 해상도에서 처리

Page 16: 다해상도 지연 렌더링

|Multi-resolution rendering pass

• Shadow 중 penumbra 영역에 대해서도

알파 값을 0 으로 지정해 상위 해상도에서

계산

Page 17: 다해상도 지연 렌더링

|Multi-resolution rendering pass

출처 :GPG 8

Page 18: 다해상도 지연 렌더링

|Composite pass

• 전체 해상도 R-Buf 의 값과 G-buf 에 미리 저장한 값들을 이용하여 최종 shading 수행

• MSAA 를 위해 geometry 를 다시 그릴 수도 있음 (lighting pre-pass 처럼 )

Page 19: 다해상도 지연 렌더링

| 마무리

• Low frequency 에서의 렌더링 cost 절약

• Diffuse interreflection, subsurface

light diffusion 을 위한 GPU 기반 빛 클러스터링 기법 (light pyramid) 들에 적용 가능–테스트 결과 , 1.5 – 2.0 배 까지 성능 향상

Page 20: 다해상도 지연 렌더링

| 감사합니다 .