fogshop: real-time design and rendering of inhomogeneous, single-scattering media
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 PresentationTRANSCRIPT
FOGSHOP: Real-time Design and Rendering of Inhomogeneous, Single-Scattering Media
John SnyderPrincipal ResearcherMicrosoft Research
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
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
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
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
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
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
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!
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
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 ˆ)(
v
s
view ray samples xi x
i
iii
iia xsxTxvTsx
IxkxL ),(),(exp)( 20
Brute Force Numerical Integration
Brute Force Numerical Integration
T(s,xi-2)
v
s
xi-2
T(v,xi-2)
i
iii
iia xsxTxvTsx
IxkxL ),(),(exp)( 20
Brute Force Numerical Integration
iii
iiia xsxTxvT
sxIxkxL ),(),(exp)( 2
0
T(s,xi-1)
v
s
xi-1
T(v,xi-1)
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)
Our Approximation: Decompose by RBFs…
dtsxTxvTsx
IxLpv
a ),(),(exp41)( 2
00
),(),(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
Our Approximation: Decompose by RBFs…
dt
xf
sxTxvTsx
Ix
dtsxTxvTsx
IxL
pv n
ii
pv
a
)(
),(),(exp41)(
),(),(exp41)(
20
01
0
20
0
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
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)(
… and compute Li with a single sample. i
rib
v
bi
trvtr ˆ)(
dtxbfdtxfxLpv
iri
pv
ii
00
)()()()(
… 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 ˆ)(
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
Computing the constant term L0
use similar light path separation trickapply analytic method of [Sun05] see paper for details
Accuracy of Our Approximation
fogshopray traced
Approximation Problems ),(),(exp
41)( 2
0 sxTxvTsx
Ixf
not
smooth
ray traced fogshop
T(x,s) discontinuous(light shafts)
small(looking at lights)
sx
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)
Environmental Airlight: Results
point airlight environment airlight
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?
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
Standard Slide without subtitleSurface Reflectance: Results
point light environment light
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
preliminary steps render depth maps from camera & lights(immersed) surface renderingairlight rendering
Standard Slide without subtitleRendering Summary
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
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
=
( )
brush/erasercopy/pasteparticle emitterairbrushreal-time light and camera change
Standard Slide without subtitleInteractive Media Design
scripted using a simple languageparabolic path default
Standard Slide without subtitleInteractive Media Design: Particle
Emitter
particles bounce off scene surfacescollision detection using kd-tree ray tracer
Standard Slide without subtitleInteractive Media Design: Airbrush
Demos
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
Contributionsanalytical model of single scattering for inhomohogeneous mediaenables visually accurate, real-time renderingeasy-to-use tools for interactive media design
Limitationsinaccurate approximation near lightslight shafts ignoredlow-frequency surface reflectanceno shadows for environmental lighting use PRT for self-shadows
Future Worklight shaftsmultiple scatteringmixed surface-surface and media-surface shadowing
Thanks!