A Practical Analytic Single Scattering Model for Real Time Rendering
A Practical Analytic Single Scattering Model for Real Time Rendering
-
Upload
armando-buckner -
Category
Documents
-
view
34 -
download
0
description
Transcript of A Practical Analytic Single Scattering Model for Real Time Rendering
A Practical Analytic Single Scattering Model for Real Time Rendering
Bo Sun Columbia University Ravi Ramamoorthi Columbia UniversitySrinivasa Narasimhan Carnegie Mellon University Shree Nayar Columbia University
Sponsors: ONR, NSF
Scattering in Participating Media
Scattering in Participating Media
Loss of contrast
Scattering in Participating Media
Loss of contrast
Dimming and blur
Scattering in Participating Media
GlowsLost of contrast Dimming and blur
Light Transport in Clear Day
Point Source
Surface PointViewer
Direct T
ransmiss
ion
Clear Day Foggy Day
Light Transport in Scattering Media
Clear Day Foggy Day
Point Source
Surface PointViewer
Direct T
ransmiss
ion
Scattered (glows)
Complexity of Rendering Scattering Media
Virtual Viewpoint
Virtual Screen
Objects
Complexity of Rendering Scattering Media
Virtual Viewpoint
Virtual Screen
Objects
Complexity of Rendering Scattering Media
Virtual Viewpoint
Virtual Screen
Objects
Complexity of Rendering Scattering Media
640 x 480 (image) x 4 (lights) x [ 50 (steps) + 100 ( directions ) x 50 (steps)] x 30 (intersect) = ?
1.9 Trillion Calculations
3.0 GHz CPU?
3 1000
Virtual Viewpoint
Virtual Screen
Objects
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
- Impressive effects, but slow
Sp
eed
Accu
racy
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
- Impressive effects, but slow
Hardware-accelerated Numerical Methods
[ Dobashi et al. 2002 ], [ Riley et al. 2004 ] ….
- Specialized for skies or clouds and Expensive precomputation
- No effects of scattering on surface radiance
Sp
eed
Accu
racy
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
- Impressive effects, but slow
Hardware-accelerated Numerical Methods
[ Dobashi et al. 2002 ], [ Riley et al. 2004 ] ….
- Specialized for skies or clouds and Expensive precomputation
- No effects of scattering on surface radiance
Glows around point sources
[ Max et al. 1986 ], [ Biri et al. 2004 ]…
- Approximations which are not feasible in many cases
- Not extendable to surface radiance and complex lighting
Sp
eed
Accu
racy
Our Technical Contributions
Explicit compact Airlight formula
Explicit Surface Radiance formula
- Accurate
- Simple fragment shader
- Fully interactive
Assumptions:
Isotropic point light sources
Homogenous media
Single scattering
No volumetric shadows
20)(d
eIk
d
xd
ed
eIk
2
0)(
d
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
x vpD
vpD
: scattering coefficient of the medium
20
d
eI d
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
: scattering coefficient of the medium
xd
ed
eIk
2
0)(
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
: scattering coefficient of the medium
xd
ed
eIk
2
0)(
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
: scattering coefficient of the medium
xd
ed
eIk
2
0)(
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
: scattering coefficient of the medium
xd
ed
eIk
2
0)(
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
vpD
: scattering coefficient of the medium
vpD
xd
dxed
eIk
02
0)(
The Airlight IntegralPoint Source, s
Surface Point, pViewer, v
svD
vpD
: scattering coefficient of the medium
vpD
xd
dxed
eIk
02
0)(
),,,( vpsvairlight DDL
The Airlight Integral
vp svsvD
x
svsv
xDxD
svsv
sv dxexDxD
e
xDDx
Dxk
I
022
cos2
22
0
cos2)
cos2
cosarccos(
4
22
),,,( vpsvairlight DDL 4D: svD vpD
We want:
- Low dimensional tabulation and cheap evaluation
- Interactively change physical parameters
vpD
xd
dxed
eIk
02
0)(
- combine and *D
- combine and svT
The Airlight Model-Solution
4D: svD vpD),,,( vpsvairlight DDL
vpD
xd
dxed
eIk
02
0)(
sin
cosarctan
2
1
4 sv
svvp
T
TT
2
sin2
cos0
2
sv
T
T
eI svsinsvT
The Airlight Model-Solution
1
2
lim
lim
exp[ d]tan),,(0 svTA ),(1 svTA
4D: svD vpD),,,( vpsvairlight DDL
vpD
xd
dxed
eIk
02
0)(
- combine and *D
- combine and svT
v
duvuF0
]tanexp[),(
1
2
lim
lim
exp[ d]tan),,(0 svTA ),(1 svTA
4D:
2D
The Airlight Model-Solution
svD vpD),,,( vpsvairlight DDL
vpD
xd
dxed
eIk
02
0)(
- combine and *D
- combine and svT
Special Function F
v
duvuF0
]tanexp[),(
Well behaved and purely numerical 2D function.
Independent of the scene.
Evaluate once for all and stored as a 2D texture.
Our Compact Airlight Formula
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
),(),( 22110 vuFvuFA 2D:
Our Compact Airlight Formula
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
),(),( 22110 vuFvuFA 2D:
Our Compact Airlight Formula
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
),(),( 22110 vuFvuFA 2D:
Our Compact Airlight Formula
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
),(),( 22110 vuFvuFA 2D:
Comparison with Monte Carlo simulation
Low RMS error shows our model is physically accurate
Video: Glows
Video clip 1
Light Transport Revisited
Point Source, s
Surface Point, p
Viewer, vn̂
BRDF
Lambertian and Phong Spheres
Lambertian Phong=10 Phong=20
Clear
Day
Foggy Day
2D:F
The Surface Radiance Model
Point Source, s
Surface Point, p
Viewer, vn̂
BRDF
1D function on i2D : Lambertian, Phong
nG0G: ,
iiairlightsurface dBRDFLL cos
Video: Diffuse and Glossy Shading
Video clip 2
The Complete Model
airlightsurfaceT LLeL vp
Airlight Model
Surface Radiance Model
2 LookupsF2 Lookups andnG0G
The Complete Model
Texture lookups
Analytic expression
NIS 4
IS8
Image size
Lights
Terms to approximate the phase function
= 5 Million
= 10 Million
15 Million VS 1.9 Trillion
airlightsurfaceT LLeL vp
Airlight Model
Surface Radiance Model
2 LookupsF2 Lookups andnG0G
float AirLight( )
{
float u = A1(beta, Dsv, gammasv);
float v1 = 0.25*PI+0.5*atan((DvpDsv*cos(gammasv))/(Dsv*sin(gammasv)));
float v2 = 0.5*gammasv;
float4 f_1=texRECT(F, v1, u);
float4 f_2=texRECT(F, v2, u);
return A0(lightIntensity, beta, Dsv, gammasv)*(f_1.x-f_2.x);
}
float SurfaceRadiance( )
{
float4 G = texRECT(G_20, Tsp, thetas);
return Ks*Io*beta/(2*Dsp*PI)*G;
}
Snap Shot of Shader Code
Video: Complex Geometry
Video clip 3
For Live Demo, please visit sketch at 10:30am, Patree Hall A.
Complex Lighting and Materials
Rendering time is linear in the number of lights.
Surface Point, p
Viewer, v
svD
vpD
n̂
BRDF
Point Spread Function
Equidistant point sources
Scattering is essentially Point Spread Function (PSF).
[Narasimhan and Nayar 2003], [Premoze et al. 2004]…
PSF
Angles
Inte
nsi
ty
Input Output
Complex Materials
Clear Day Foggy Day
PSF
Angles
Inte
nsi
ty
BRDF
Effective BRDF
with Scattering
Environment Maps
Clear Day Foggy Day
PSF
Angles
Inte
nsi
ty
Lighting
Foggy Lighting
PSF for Complex Lighting and Material
Video clip 4 and 5
Visual Effects and Performance Comparisons
Methods Shadows GlowsSurface shading
Complex
lighting&
materials
Real Time
OpenGL Like
Monte Carlo
Numerical Simulation
Other Analytic Methods
Our Model
Visual Effects and Performance Comparisons
Methods Shadows GlowsSurface shading
Complex
lighting&
materials
Real Time
OpenGL Like
Monte Carlo
Numerical Simulation
Other Analytic Methods
Our Model
Visual Effects and Performance Comparisons
Methods Shadows GlowsSurface shading
Complex
lighting&
materials
Real Time
OpenGL Like
Monte Carlo
Numerical Simulation
Other Analytic Methods
Our Model
50fps 40fps
Summary
Analytic Airlight Model
An OpenGL-Like Practical Real-Time Rendering Technique:
Summary
Analytic Airlight Model
Analytic Surface Radiance Model
An OpenGL-Like Practical Real-Time Rendering Technique:
40fps 50fps
Summary
Analytic Airlight Model
Analytic Surface Radiance Model
PSF for Complex Lighting and Natural Materials
An OpenGL-Like Practical Real-Time Rendering Technique:
100fps 20fps
Acknowledgement
R. Wang, J. Tran and D. Luebke for the PRT code.
S. Premoze for the Monte Carlo simulation code.
P. Debevec for the light probes.
W. Matusik for the tabulated BRDF.
Supported by a Columbia University Presidential Fellowship, an ONR Grant, an NSF Grant, an NSF CAREER award, and equipment donations from Intel and NVIDIA.
Thanks for Listening!Maya Plug-in, 2D tables, and Shader code:
http://www.cs.columbia.edu/~bosun/research.htm
The End
The End