jeong-soo park 2011/05/31 media system lab. yonsei univ

31
The Design of Acceleration Algorithm for Real-time Ray Tracing Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ.

Upload: georgiana-gaines

Post on 21-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

The Design of Acceleration Al-gorithm for Real-time Ray Trac-

ing

Jeong-soo Park

2011/05/31Media System Lab.Yonsei Univ.

Page 2: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* 졸업 요건 요약

논문명 논문지 비고

국제 저널

An effective depth data memory system using anescape count buffer for 3D rendering processors

IEICE express, Vol. 8, No. 4 출판

A Latency-efficient Stencil/depth Buffer System forMobile 3D Rendering Processors

IEICE express심사 중 (reviewer se-lected)

국제 학회 Ordered Depth-First Layouts for Ray TracingSIGGRAPH Asia 2010, sketches

국내 저널3 차원 그래픽 래스터라이제이션에서 스테실 데이터 압축 및 접근 패턴 연구

한국게임학회 논문지

작성 중 (80%)

Page 3: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* 목차

1. Introduction– Benefit of Ray Tracing

– Why today’s issue?

– Contributions

2. Background & Related Work– Basics of Ray Tracing

– Technical Categorization

• RT execution platform

• Acceleration technique

3. Ray Differentials for Adaptive Level-of-Detail– Derivation of ray differential

– Ray-diff for texture filtering

– Ray-diff for adaptive antialiasing

4. Probability Heuristics for Ray Tracing Acceleration

5. Simulation Environment for Graphics Acceleration Hardware

6. Conclusion & Future Work

Page 4: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

Introduction

Page 5: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Benefit of Ray Tracing

• High degree of realistic image

– Support reflection, refraction, caustics naturally

– Calculate physically-correct lighting effect

– Simulate interference between primitives in the scene

5

Ray tracing is one of global illumination algorithm to synthesize high degree realistic images as well as to

process 3D scene more efficiently than Z-buffer algorithm

Image of nVidia. :Optix : INTERACTIVE RAY TRACING ON NVIDIA QUADRO PROFESSIONAL GRAPHICS SOLUTIONS,” developer.nvidia.com, 2009

Page 6: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Barrier of Ray Tracing

• Computation

– All operations are based on real

numbers

– High amount of computations

• For example:– Image resolution : 1280 x 720,

Scene size : 100K primitives, 10

propagations

– 1280 x 720 x 100K x 10 = 858G

times intersection test and shading

6

However ray tracing has several barriers to achieve in real-time performance, which are its types and amount of

computations.

objectresolution

R N

propagation

D

Color O(#pixel * #obj * #propagation)

Page 7: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Why Today’s Issue

• Hardware performance growth

– Raw performance of CPU/GPU in-

creased

• GPU as massive parallel architec-

ture

– More parallelism exploited

• Even CPU starts to expand parallel-

ism

• Ray tracing algorithm is highly

parallel

7

Even so, there are several trends that realizes real-time performance of ray tracing.

*Nvidia developer center

Parallel architect`ure in commodity PC*

*Larrabee architecture

*Intel, “Larrabee: A Many-Core x86 Architecture for Visual Computing,” SIGGRAPH 2008

Page 8: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Why Today’s issue

• Industrial demands for advanced, realistic graphics

– In addition to be getting complex, it becomes more real-time

8

Even so, there are several trends that realizes real-time performance of ray tracing.

Expendable(1999)Quake 3(1999) Half-Life 2(2004)

Real-time Rendering (Game)Crysis 2(2011)

A Bugs Life(1998)Toy Story(1995) Car(2006)Finding Nemo(2003)

TextureMapping

BumpMapping HDRI

RayTracing

High Quality Rendering (Movie)

Page 9: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

Background & Related Work

Page 10: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Basics of Ray Tracing

• Ray tracing processes RAYS to SEARCH corresponding primitives

– Basically searching algorithm

– Z-buffered algorithm processes primitives to sort its projective position

Ray tracing algorithm is essentially searching algorithm that finds the primitive that contributes to the screen

Processing PRIMITIVES to SORT onto image plane

Processing RAYS to SEARCH contributing objects

Z-buffered rasterization Ray tracing

10

Page 11: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Acceleration Algorithms

There are several works for accelerating ray tracing to real-time performance.

11

• Ray tracing Acceleration works

– Acceleration structure : pre-indexing primitives with auxiliary data structure

– Core acceleration : optimize efficiency of RT core algorithm (traversal & intersection

test)

– Execution platform : exploiting hardware resources efficiently Search Algo-

rithmRay tracing

Acceleration Structure

• Grid[Kalojanov11], BVH[Lauterbach09], KD-tree, • Fast build/update[Kalojanov09, Pantaleoni10]

Core Acceleration • MLRTA[Reshtov05], Packet[Boulos08] • Fast IST[Havel09]

Platform • CPU/GPU• GPU[Parker10, Aila09], Multi-core[Wald10, Seiler08]

• GPU build [Lauterbach09]

Page 12: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

Ray Differentials for Adaptive

LOD

Page 13: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Introduction

• Regular sampling of ray tracing aliasing problem

• Solution

– Stochastic sampling

• More rays per pixel, EXPENSIVE– Eg.) Distribution ray tracing, Path tracing

– Texture filtering (like rasterization)

• Filtering texels in a pixel, or choose from prefiltered texture map (MIPMAP)

• Filtering kernel is ray’s footprint on texture space

How to know ray’s footprint along ray traversal

Like other rendering algorithm, ray tracing is another regular sampling technique. It also suffers from aliasing

problem.

13

Page 14: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Related works

• BMRT[Gritz96]

– Estimating difference based on ray

traversal distance

– Only valid for primary ray

– Could not support convergence/di-

vergence of ray ( lens effect )

• Tracing ray differential[Igehy99]

– Derivatives of world coordinate po-

sition

– Used for geometry subdivision in

offline renderer [Christensen03,

Christensen06]

Several works has been announced to eliminate aliasing problem in texture mapping

14

Page 15: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Tracing Ray Differential

• Essentially tracing derivatives of ray’s starting point (P) and its direction (D)

– Keep track of whether ray is expanding or shrinking

15

𝜕 𝑥

𝑃 (𝑥 , 𝑦)

𝑃 (𝑥+𝜕𝑥 , 𝑦 )

𝝏 𝑷 (𝒙 , 𝒚 )

𝝏 𝑫 (𝒙 , 𝒚 )𝐷(𝑥 , 𝑦 )

𝐷(𝑥+𝜕 𝑥 , 𝑦 )

Page 16: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Derivation of Ray Differential

Ray generation Ray differential

Primary ray

Reflection Ray

Refraction Ray

Barycentric Coor-dinate

Ray differential is partial derivatives of ray parameters of x, y. Hence ray differentials for each types of ray

could be found by differentiating ray generation equation.

16

Page 17: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Ray differentials for texture filtering

• Longer edge (R1 or R2) is selected

for filtering kernel size

• For Mipmapping, appropriate level

of mipmap is calculated as:

17

size =

𝒍𝒆𝒗𝒆𝒍=(𝒊𝒏𝒕 ) log𝟐(𝒔𝒊𝒛𝒆)

Page 18: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Ray differential pipeline design

• Ray differential unit needs 3 DOT3, 17 MUL, 10 ADD, 1 DIV, 1 SQRT

18

At ray generation stage, differential unit calculates ray differential according to type of ray.

Primary ray

DOT3 (1)

DIV (1)

DOT3(2)

SQRT (1)

MUL (3)MUL (12)

ADD (6)

MUL (1)

MUL (1)

P1

P2

P3

P4

P5

P6

P7

P8

P9

P10

P11

P12

P13

P14

P15

Reflection ray

DOT3 (1)

MUL (1)

MUL (3)

MUL (1)MUL (3)

ADD (6)

DOT3(1)

Refraction ray

DIV (1)

MUL (1)

MUL (1)

ADD (1)

MUL (2)MUL (12)

ADD (6)

DOT3 (1)

DOT3(1)

Page 19: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Result

19

Scene comparison (no filtering – distance based – ray differential )

Base Distance base Ray differential base

Base Distance base Ray differential base

Page 20: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Result

20

Scene comparison (no filtering – distance based – ray differential )

Base Distance base Ray differential base

Page 21: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

Conclusion & Future work

Page 22: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Conclusion & Future works

• Ray differential could estimated size of ray footprint as the ray propagates

• By differentiating function of world-to-texture space transformation, it is possible

to calculate footprint on the texture

• Texture space footprint could be used to compute:

– Filtering kernel size

– Level of mipmap

• Adaptive supersampling by differential scheme

– Transform ray differential barycentric differential

22

Page 23: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

Backup

Page 24: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Edge detection using ray differential

• For each sub-pixel, check conditions:

Barycentric coordinate differential could be used to estimate hit-point of neighbor rays

𝜕𝑃𝜕 𝑥

𝜕𝑃𝜕 𝑦

3 4

1 2

Page 25: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Result

25

Scene comparison (no filtering – distance based – ray differential )

Page 26: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Why today’s issue

• Hardware performance growth

– Raw performance of CPU/GPU in-

creased

• GPU as massive parallel architec-

ture

– More parallelism exploited

• Even CPU starts to expand parallel-

ism

• Ray tracing algorithm is highly

parallel

Even so, there are several trends that realizes real-time performance of ray tracing.

CE/ 표준

CE/ 표준

CE/ 표준Gflops growth

CPUGPU

Gtx 480

Gtx 200

G92

G80

Core2 XeonI7 980

Page 27: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* 목차

1. Introduction

– Benefit of Ray Tracing

– Why today’s issue?

– Contributions

2. Background & Related Work

– Basics of Ray Tracing

– Technical Categorization

• RT execution platform

• Acceleration technique

3. Ray Differentials for Adaptive LOD

– Derivation of ray differential

– Ray-diff for texture filtering

– Ray-diff for adaptive antialiasing

4. New Heuristics for Accelerating RT

5. Simulation Environment for Advanced Computer Graphics

6. Conclusion & Future Work

Page 28: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* Benefit of Ray Tracing

• Benefit – High Image Quality

• Support reflection, refraction, caus-

tics naturally

• Calculate lighting effect globally

– Efficient processing

• Logarithmic behavior to scene

complexity

• Only process the primitive that con-

tributes to final image

28

Ray tracing is one of global illumination algorithm to synthesize high degree realistic images as well as to

process 3D scene more efficiently than Z-buffer algorithm

*Daniel Pohl, “Ray Tracing and Gaming,” PC perspective articles from Intel, Jan. 2008

Z-buffer algorithm

Ray Tracing

ComputationBehavior of graphics algorithm*

Page 29: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

*

성능

사실성

29

현재 그래픽스 기술의 문제점

• 지역 조명 기반으로 인한 사실감의 한계• 각 물체와 광원과의 관계만 고려

• Eg. 1’ 에 드리워지는 3’ 의 그림자 표현 불가• 인접한 물체간의 위치 관계를 표현하지 못함

• 특정 물체를 처리할 때 다른 물체의 위치를 모름• Eg. 4 에 비친 1 의 영상을 표현 못함

• 성능효율이 낮음• 비가시 영역에 대해 불필요한 렌더링작업 수행

• Eg. 3 에 의해 가려지는 2 의 영역까지 렌더링수행• 사실감 개선을 위한 중복 렌더링

• Eg. 5 를 다시 렌더링하여 1 에 대한 반사를 표현• 물체의 수에 선형 복잡도를 가짐

• 장면을 구성하는 모든 물체 (N 개 ) 에 대해 렌더링 수행 (Linear complexity: O(N) )

• 그래픽 application 의 영상 복잡도는 급격한 증가추세

5’

3

2

1

Graphics Pipeline

2

1’

3’

N 5

4

Page 30: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

*

1

Global Illumination 기법의 장점

30

성능

사실성

• 실감있는 직접 조명 효과 재현• 광선의 연쇄추적을 통해 실제와 유사한 빛의 반사 , 굴절 ,

그림자를 재현 (simulation)• Eg. 1 에서 광원에 대해 그림자 ray 추적 , 4 에서

1 에 대한 반사 ray 추적• 간접조명 효과 재현

• 광원에서 생성되는 간접조명효과 지원• Eg. 3 에 의한 간접조명 효과로 1 의 색상이 바뀜

• 효율적인 렌더링 처리• 물체가 아닌 생성한 광선을 시스템에서 처리• 광선 역추적으로 현 시점에서 가시영역만 렌더링 수행

• 계산 복잡도가 낮음• 공간상에 배치된 각 물체를 tree 구조화하여 물체 수 (N)

에 대해 Log(N) 의 복잡도를 가짐• 장면 복잡도 증가에 효과적으로 대응

23

1

Shadow ray

Eye ray

Reflection ray

Refraction ray

4

Page 31: Jeong-soo Park 2011/05/31 Media System Lab. Yonsei Univ

* 목차

• Introduction

• Background & Related Work

• Ray Differentials for Adaptive LOD

• New Heuristics for Accelerating RT

• Simulation Environment for Advanced Computer Graphics

• Conclusion & Future Work