Fast Global-Illumination on Dynamic Height Fields Derek Nowrouzezahrai University of Toronto John Snyder Microsoft Research.

Download Report

Transcript Fast Global-Illumination on Dynamic Height Fields Derek Nowrouzezahrai University of Toronto John Snyder Microsoft Research.

Fast Global-Illumination on Dynamic Height Fields

Derek Nowrouzezahrai University of Toronto John Snyder Microsoft Research

Related Work

• static geometry [Sloan02; Ng04; …] • dynamic geometry [Bunnell05, Ren06, Sloan07, Ritschel08] 3

Related Work

• screen-space shading [Shanmugam07;Ritschel09…] – ignores view-occluded blockers [Dimitrov08] • horizon mapping [Max88; …] – precomputation for hard shadows on static geometry 4 [Sloan&Cohen00]

Related Work

• fast soft-shadowing on dynamic height fields [SN08] 5

Goals

• all of [SN08]

as well as

– dynamic indirect illumination – glossy effects (direct and indirect) 6

Goals

[SN08] Our results

7

Goals

• unified formulation for direct- and indirect-illumination • diffuse and glossy bounces • environmental + directional lighting • dynamic geometry (not precomputed) • real-time performance • simple implementation • limitation: geometry is a

height field

• applications: – terrain rendering (flight simulators, games, mapping/navigation) – data visualization 8

Summary of Main Ideas

1.

approximate

visibility

&

incident radiance

w/ multi-resolution create height and shading

pyramids

sample from pyramid levels pre-filter data 2.

compute visibility and radiance at discrete azimuthal directions 3.

determine final spherical visibility and incident radiance 9

Azimuthal Swaths [ SN08 ]

• for smaller area (key) light sources: – restrict azimuthal extent and use

m = 3

 get sharper shadows  acts as a

geometric mask

 only sample where necessary –

env

lights and

incident radiance

: – complete swath and use

m = 32

10

Definitions and Notation

blocking angle

:  (

t

)

incident radiance

:

u

(

t

) angle

p

makes at

t

along  incident radiance at

t

towards

p

along 

u

(

t

)  (

t

) Sample  and

u

at all points

t

along direction  .

11

Calculating the Max Blocking Angle

max

12

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

16

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

t

Calculating the Max Blocking Angle

max

t

21

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

22

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

Calculating the Incident Radiance

 Which points on the height field contribute indirect radiance?

The set of points with

monotonically increasing

We call this the

casting set

.

blocking angles.

32

Brute Force Sampling – Pitfall…

Problem:

aliasing

– need

many

samples in

t

.

Solution:

prefilter

data, apply

multi-scale sampling

.

33

Multi-Resolution Height Sampling

f i

height pyramid level

i

sampling distance for level

i f i τ i

Sample coarser levels further from

x

.

f i-1 f i-2 τ i-2 f i-3 τ i-3 τ i-1

34

Multi-Resolution Radiance Sampling

u

( 

i

) 

u i

( 

i

) multi-scale incident radiance samples

u i

i

radiance pyramid (for the previous bounce) blocking angle at 

i u i τ i

Sample coarser levels further from

x

.

u i-1 u i-2 τ i-2 u i-3 τ i-3 τ i-1

35

Summary of Main Ideas

1.

approximate

visibility

&

incident radiance

w/ multi-resolution 2.

compute visibility and radiance at discrete azimuthal directions -

analytic

visibility and incident radiance use

normalized Legendre polynomials (NLP

s

)

3.

determine final spherical visibility and incident radiance 36

Analytic Occlusion Elevation Function

(  • we start with the binary

occlusion

function:

v

)

σ

0

v

(  ;  )    1 0 , , if    otherwise

1

and represent it analytically in the

Normalized Legendre Polynomial

(

NLP

) basis: 37

Analytic Visibility and IR

• can represent visibility and incident radiance in

NLP

with

v

(  / 2 ) • visibility

1

v

( 

max

) 

max

binary function with 1 transition from 0 to 1 @ 

-

max

as 

=

v

(  )

1

max v

0

• incident radiance  R G B

u

(

t

0 )

v

(  (

t

0 ))

piece-wise constant

, function of elevation

+

u

(

t

1 ) 

v

(  (

t

1 )) 

v

(  (

t

0 )) 

+

u

(

t

2 ) 

v

(  (

t

2 )) 

v

(  (

t

1 )) 

=

u

(  )

u

(

t

2 )

u

(

t

1 )

u

(

t

0 ) 38

Summary of Main Ideas

1.

2.

approximate

visibility

&

incident radiance

w/ multi-resolution compute visibility and radiance at discrete azimuthal directions 3.

determine final spherical visibility and incident radiance NLP  SH blending & projection fast shading pipeline 39

From Sampled NLP to Full SH

• given (2 x

m

) NLP vectors • need full spherical functions (represented in SH) •

interpolate

between azimuthal samples

project

resulting spherical function into SH • requires only 1 pre-computed matrix!

+

• matrix acts on NLP coefficients at edges of each swath • rotate & sum across swaths for final SH All operations performed in a single GPGPU shader. See

supplemental material

for full source code.

40

Global Illumination Shading with SH

• at each shading point:

v

&

u

compute

m

azimuthal visibility + incident radiance NLP vectors

V

&

U

interpolate & project into SH. Rotate & sum across directions

N

x

or R

x

or

x

)

x

) BRDF: clamped cosine and/or Phong lobe

L

external lighting environment 41

Global Illumination Shading with SH

Direct Illumination: BRDF x Visibility SH Product

T x

V x

 f (

N

x ) and take inner product with lighting

T x

,

L

Indirect Illumination: BRDF take inner product with Incident Radiance f (

N

x ),

U

42

Comparison to Ground Truth

m

= 32 ground truth

43

Memory Usage

• we typically sub-sample visibility & IR • shade with full-resolution geometry & normals

HF resolution

256 x 256 (130k triangles) 512 x 512 (522k triangles) 1024 x 1024 (2.1M triangles) 2048 x 2048 (8.4M triangles)

pyramid levels

33

memory requirements

no sub-sampling 17.4 MB 2x sub-sampling 4.5 MB 37 41 45 76 MB 336 MB 1.4 GB 20 MB 88 MB 360 MB 44

Measured Performance HF resolution FPS (nVidia GTX 285)

no

ss

2x

ss

4x

ss

256 x 256 (130k triangles) 512 x 512 (522k triangles) 1024 x 1024 (2.1M triangles) 50 12 3 125 36 8 229 73 19 45

Results

47

Results

48

Conclusions

• multi-resolution sampling of: • visibility • incident radiance • compact, analytic representation of: • elevation-only functions • SH interpolation and projection operators • simple GPU implementation • real-time up to 512x512 dynamic HFs • can sub-sample visibility and incident radiance • performance independent of geometric content 49

Future Work

• combine with dynamic shadow casters – via [Ren06;Sloan07] (sphere set blocker approximation) • apply to image-space global illumination frameworks • generalize geometry – local height field displacements – tiled height field representations 50

We acknowledge the helpful suggestions of the anonymous reviewers.

Thanks! Any questions?