21
Inferred Lighting: Fast Dynamic lighting and shadows for opaque and translucent objects original paper by Scott Kircher, Alan Lawrance http://cafe.naver.com/shader 임임임 ([email protected])

Inferred Lighting

Embed Size (px)

Citation preview

Page 1: Inferred Lighting

Inferred Lighting:Fast Dynamic lighting and shadows for opaque and translucent objects

original paper by Scott Kircher, Alan Lawrance

http://cafe.naver.com/shader

임용균 ([email protected])

Page 2: Inferred Lighting

Forward Rendering

•많은 동적 라이팅 (dynamic lighting)•라이트가 많아질 수록 성능이 급격히 낮아짐•다양한 재질 (material)•알파 오브젝트의 라이팅과 그림자•하드웨어 MSAA

Page 3: Inferred Lighting

Deferred Shading• Geometry Pass

▫ 조명 계산에 필요한 속성들 (Color, Depth, Normal, Specular)을 프레임 버퍼와 동일한 크기의 텍스쳐 (G-Buffer) 에 렌더링

• Light Pass▫ 각각의 조명에 대해 영향 받는 픽셀들을 라이팅하여 프레임 버퍼에

누적 실제로 보이는 픽셀만 라이팅

Page 4: Inferred Lighting

Deferred Shading

Page 5: Inferred Lighting

Deferred Shading

•많은 동적 라이팅 (dynamic lighting)•높은 성능•다양한 재질 (material) 표현이 어려움•알파 오브젝트의 라이팅과 그림자•하드웨어 MSAA 지원을 받지 못함 *

Page 6: Inferred Lighting

Light Pre-Pass Rendering• Geometry Pass

▫ 조명 계산에 필요한 속성들 (Depth, Normal) 을 최소화하여 프레임 버퍼와 동일한 크기의 텍스쳐 (G-Buffer) 에 렌더링

Page 7: Inferred Lighting

Light Pre-Pass Rendering• Light Pass

▫ 각각의 조명에 대해 영향 받는 픽셀들을 라이팅하여 프레임 버퍼와 동일한 크기의 텍스쳐 (L-Buffer) 에 렌더링

Page 8: Inferred Lighting

Light Pre-Pass Rendering• Material Pass

▫ 프레임 버퍼에 Forward Rendering 을 하면서 L-Buffer 의 결과를 참조하여 L-Buffer * Material 로 최종 color 값을 계산한다 .

Page 9: Inferred Lighting

Light Pre-Pass Rendering

•많은 동적 라이팅 (dynamic lighting)•높은 성능 *•다양한 재질 (material)•알파 오브젝트의 라이팅과 그림자•하드웨어 MSAA*

Page 10: Inferred Lighting

Inferred Lighting

•많은 동적 라이팅 (dynamic lighting)•높은 성능•다양한 재질 (material)•알파 오브젝트의 라이팅과 그림자•하드웨어 MSAA

Page 11: Inferred Lighting

Main Idea• 저해상도 / 고해상도 (mixed) 버퍼를 사용

▫Geometry Pass G-Buffer 를 Back Buffer 보다 작은 사이즈로 렌더링

▫Light Pass G-Buffer 를 이용하여 라이팅 결과를 L-Buffer 에 렌더링

▫Material Pass Scene 을 Forward Rendering 하면서 L-Buffer 의

결과에 Material 을 적용한다 . (Up Sampling)

• DSF(Discontinuity Sensitive Filtering) 를 이용해 저해상도 -> 고해상도로 up-sampling

Page 12: Inferred Lighting

Inferred Lighting

Geometry Pass: 800x450

Light Pass: 800x450Material Pass: 1280x720, 8x MSAA

Page 13: Inferred Lighting

DSF (Discontinuity Sensitive Filtering)

• 저해상도 -> 고해상도 up-sampling 되면서 극심한 edge aliasing 이 발생

Bilinear filter

DSF

Page 14: Inferred Lighting
Page 15: Inferred Lighting

Determining Lighting Sample Validity

• normal 과 depth 를 비교▫ Bilateral filtering

Slow •Two textures•Nonlinear depth•Normal reconstruction

Page 16: Inferred Lighting

DSF Buffer

•Linear Depth (red)•Object/Instance ID (green)•Normal Group ID (blue)

Single ID in DSF buffer (DSF ID)

Page 17: Inferred Lighting

Using DSF Buffer• Depth 와 ID 를 비교한다 .• bias bilinear filtering weights• material 정보와 결합

Pixel ShaderD

ep

th

DS

F

ID

Fetch Fetch

Albe

do, e

tc…

Page 18: Inferred Lighting

Light Pre-Pass Rendering (33fps)

•DSF

Page 19: Inferred Lighting

Inferred Lighting (40fps)

•DSF

Page 20: Inferred Lighting

Inferred Lighting vs. Forward Render-ing

•101 objects, 81 lights. (xbox360)▫Inferred Lighting: 29.4ms (34fps)▫Forward Rendering: 167ms (6fps)

Page 21: Inferred Lighting

References

•http://graphics.cs.uiuc.edu/~kircher/publications.html

•[GDC04] Deferred Shading (Shawn Harg-reaves)