fogshop: real-time design and rendering of inhomogeneous, single-scattering media

43
FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single- Scattering Media John Snyder Principal Researcher Microsoft Research Slide

Upload: dannon

Post on 24-Feb-2016

52 views

Category:

Documents


0 download

DESCRIPTION

Presentation/Presenter Title Slide. John Snyder Principal Researcher Microsoft Research. FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media. Collaborators. paper will appear in Pacific Graphics 2007. Kun Zhou, MSRA - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

John SnyderPrincipal ResearcherMicrosoft Research

Page 2: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Collaborators

• Kun Zhou, MSRA• Qiming Hou, Tsinghua Univ. (intern at MSRA)

• Minmin Gong, MSRA• Baining Guo, MSRA• Heung-Yeung Shum, MSRA

paper will appear in Pacific Graphics

2007

Page 3: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Previous Real-Time Techniques

homogeneous fog no spatial variation

layered fog using textures

vertical variation only problems with immersed

scene objectsvolume rendering

ignores halos/shadows

Standard Slide without subtitle

Page 4: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

RBF model supports large environments scripted particle systems immersed viewer

point lighting: media’s appearance and shadows

environmental lighting: media’s appearance only

surface reflectance due to immersion in media

noise additioneasy-to-use design system

Standard Slide without subtitleFogshop Features

Page 5: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Modeling Inhomogeneous Media with Gaussian RBFs

optical density = sum of n 3D Gaussian blobs + constant:

easy-to-control modelcompatible with particle systemsanalytic line integral via erf(x)

Standard Slide without subtitle

01

n

ii xx

22exp iiii bxacx

biai ci

Page 6: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

T(a,b) is optical depth between 3D points a and b:

light from ab attenuated by exp(-T(a,b))

Standard Slide without subtitle

viewer, vsurface point, p

point light, s

attenuated by exp(-T(v,p))

Attenuation by Inhomogeneous Fog

n

i i

n

i

ab

i

ab

ab

baTab

dtxdt

ababtatxdtxbaT

10

1 00 0

0

),(

)()(,,

integrate density along

path ab

Page 7: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Computing Optical Depth via RBF Splatting

draw bounding box for each RBFintegrate analytically in pixel shaderaccumulate over n blobs using alpha blending

multiple splats integrate optical

depth

single RBF splat

Page 8: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

airlight models lighted media’s direct appearancedue to light scattering by fog particlesincludes self-shadowing and haloing effects

Standard Slide without subtitle

simple blending fogshop (single scattering)

Fog scatters, not just attenuates, light!

Page 9: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

light scatters once off fog particle at x path consists of two segments exponential attenuation along each segmentaccurate for thin media, plausible for denser

Standard Slide without subtitle

viewer, vsurface point, p

point light, s

x view ray

Single-Scattering Model for Airlight

Page 10: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Standard Slide without subtitle

v p

s

T(v,x)

T(s,x)

x

Single-Scattering Integral dtxsTxvT

sxIxkxL

pv

a ),(),(exp)( 20

0

La : airlight along view rayx : scattering location, (x) : optical density at x(x) : scattering angle

k() : phase function [constant]I0 : light intensityT(v,x), T(s,x) : optical depths

trvtrx ˆ)(

Page 11: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

v

s

view ray samples xi x

i

iii

iia xsxTxvTsx

IxkxL ),(),(exp)( 20

Brute Force Numerical Integration

Page 12: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Brute Force Numerical Integration

T(s,xi-2)

v

s

xi-2

T(v,xi-2)

i

iii

iia xsxTxvTsx

IxkxL ),(),(exp)( 20

Page 13: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Brute Force Numerical Integration

iii

iiia xsxTxvT

sxIxkxL ),(),(exp)( 2

0

T(s,xi-1)

v

s

xi-1

T(v,xi-1)

Page 14: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Brute Force Numerical Integration

• need many samples xi along each view ray• two optical depth evals per sample, per ray: T(v,xi),

T(s,xi) • too expensive for real-time!

i

iii

iia xsxTxvTsx

IxkxL ),(),(exp)( 20

T(s,xi)

v

s

xi

T(v,xi)

Page 15: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Our Approximation: Decompose by RBFs…

dtsxTxvTsx

IxLpv

a ),(),(exp41)( 2

00

Page 16: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

),(),(exp41

20 sxTxvTsx

I

Our Approximation: Decompose by RBFs…

dtsxTxvTsx

Ix

dtsxTxvTsx

IxL

pv n

ii

pv

a

),(),(exp41)(

),(),(exp41)(

20

01

0

20

0

Page 17: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Our Approximation: Decompose by RBFs…

dt

xf

sxTxvTsx

Ix

dtsxTxvTsx

IxL

pv n

ii

pv

a

)(

),(),(exp41)(

),(),(exp41)(

20

01

0

20

0

Page 18: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Our Approximation: Decompose by RBFs…

dtxfxdtxf

dt

xf

sxTxvTsx

Ix

dtsxTxvTsx

IxL

pv

i

pv

pv n

ii

pv

a

)()()(

)(

),(),(exp41)(

),(),(exp41)(

00 0

20

01

0

20

0

Page 19: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Our Approximation: Decompose by RBFs…

n

ii

n

i

i

pv

i

pv

pv n

ii

pv

a

LL

L

dtxfx

L

dtxf

dt

xf

sxTxvTsx

Ix

dtsxTxvTsx

IxL

10

10

0

0 0

20

01

0

20

0

)()()(

)(

),(),(exp41)(

),(),(exp41)(

Page 20: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

… and compute Li with a single sample. i

rib

v

bi

trvtr ˆ)(

dtxbfdtxfxLpv

iri

pv

ii

00

)()()()(

Page 21: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

… and compute Li with a single sample.

• projected center is point of max density along view ray

• assumes f (x) smooth wrt blob’s width• i integrated analytically• still need two optical depth integrations to evaluate

)( ribf

dtxbfdtxfxLpv

iri

pv

ii

00

)()()()(

rib

i

rib

v

bi

trvtr ˆ)(

Page 22: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

use red light path through for blob i [varies per ray]

use blue light path through bi for other blobs j ≠ i [invariant]

rii bsT ,

rii bvT , ii bsT ,~

ii bvT ,~ib

rib

v

s

Computing Li : Separate Light Paths

),(for similarly and ...

),(),(),(

),(~),(),(

ri

iiirii

iirii

ri

bvT

bsTbsTbsT

bsTbsTbsT

rib

Reuse optical depth integrals over many view rays.

iT

iT

Page 23: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Computing the constant term L0

use similar light path separation trickapply analytic method of [Sun05] see paper for details

Page 24: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Accuracy of Our Approximation

fogshopray traced

Page 25: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Approximation Problems ),(),(exp

41)( 2

0 sxTxvTsx

Ixf

not

smooth

ray traced fogshop

T(x,s) discontinuous(light shafts)

small(looking at lights)

sx

Page 26: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Environmental Airlight

L : environment lighting in SH basisTr : optical depth along view ray r from v∞

attenuated & scatteredonly attenuated

PSFLTTLTL rrra *)exp()exp(

* =PSFL

(before scatter)L*PSF

(after scatter)

Page 27: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Environmental Airlight: Results

point airlight environment airlight

Page 28: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

surfaces immersed in mediumincident radiance affected by scatteringsubtle yet noticeable effects:

softened shading blurred highlight media’s shadow

can get away with lots of approximation

Standard Slide without subtitleSurface Reflectance: Why?

Page 29: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

assume homogeneous medium of average density average varies at each pixel, creating inhomogeneous effects point light: average in single direction sp environment light: average all around puse SH lighting and PSF (point spread function) [Sun05]

Standard Slide without subtitleSurface Reflectance: How?

point light s environment light L

pp

Page 30: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Standard Slide without subtitleSurface Reflectance: Results

point light environment light

Page 31: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

break up RBF’s circular shape perturb view rays, indexed by be consistent when camera rotates add noise in world space

Standard Slide without subtitleAdding Noise

without noise with noise

view rayperturbed view ray

v

noise perturbation

rib

rib

Page 32: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

preliminary steps render depth maps from camera & lights(immersed) surface renderingairlight rendering

Standard Slide without subtitleRendering Summary

Page 33: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

compute T(s,p) for each point light s using RBF splatting to cube mapcompute average optical depth at object centers if using environmental lightingshade per-vertexrender to scene target

Standard Slide without subtitleSurface Rendering

Page 34: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

compute T(v,bi), T(s,v), T(s,bi) plane sweep algorithm on CPUaccumulate airlight and screen optical depth T(v,p) perturb view rays if noise enabled computed on GPUattenuate scene target and add airlight

Standard Slide without subtitleAirlight Rendering

+scene target optical depth airlight

result

=

( )

Page 35: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

brush/erasercopy/pasteparticle emitterairbrushreal-time light and camera change

Standard Slide without subtitleInteractive Media Design

Page 36: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

scripted using a simple languageparabolic path default

Standard Slide without subtitleInteractive Media Design: Particle

Emitter

Page 37: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

particles bounce off scene surfacescollision detection using kd-tree ray tracer

Standard Slide without subtitleInteractive Media Design: Airbrush

Page 38: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Demos

Page 39: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Performancescene #

vertices#

RBFs # lights fps

gargoyle 78,054 34 3 101box 8,901 3008 1 34terrain 65,047 292 env. map 92city 77,226 353 env. map 162motorcycle 44,430 1223 env. map 31

Page 40: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Contributionsanalytical model of single scattering for inhomohogeneous mediaenables visually accurate, real-time renderingeasy-to-use tools for interactive media design

Page 41: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Limitationsinaccurate approximation near lightslight shafts ignoredlow-frequency surface reflectanceno shadows for environmental lighting use PRT for self-shadows

Page 42: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Future Worklight shaftsmultiple scatteringmixed surface-surface and media-surface shadowing

Page 43: FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media

Thanks!