A Practical Analytic Single Scattering Model for Real Time Rendering Bo Sun Ravi Ramamoorthi Srinivasa Narasimhan Shree Nayar Columbia University Columbia University Carnegie Mellon University Columbia University Sponsors: ONR, NSF.
Download
Report
Transcript A Practical Analytic Single Scattering Model for Real Time Rendering Bo Sun Ravi Ramamoorthi Srinivasa Narasimhan Shree Nayar Columbia University Columbia University Carnegie Mellon University Columbia University Sponsors: ONR, NSF.
A Practical Analytic Single Scattering
Model for Real Time Rendering
Bo Sun
Ravi Ramamoorthi
Srinivasa Narasimhan
Shree Nayar
Columbia University
Columbia University
Carnegie Mellon University
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
Lost of contrast
Dimming and blur
Glows
Light Transport in Clear Day
Point Source
Viewer
Surface Point
Light Transport in Scattering Media
Scattered (glows)
Viewer
Point Source
Surface Point
Clear Day
Foggy Day
Complexity of Rendering Scattering Media
Objects
Virtual Viewpoint
Virtual Screen
Complexity of Rendering Scattering Media
Objects
Virtual Viewpoint
Virtual Screen
Complexity of Rendering Scattering Media
Objects
Virtual Viewpoint
Virtual Screen
Complexity of Rendering Scattering Media
Objects
Virtual Viewpoint
Virtual Screen
640 x 480 (image) x 4 (lights) x [ 50 (steps) + 100 ( directions ) x 50 (steps)] x 30 3
1.9 Trillion Calculations
3.0 GHz CPU?
1000 (intersect) = ?
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
Speed
Accuracy
- Impressive effects, but slow
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
Speed
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
Accuracy
- Impressive effects, but slow
Previous Work
Monte Carlo Ray Tracing Methods
[Kajiya and Herzen 1984], [Max et al. 1994]…
Speed
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
Accuracy
- Impressive effects, but slow
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
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
d
Surface Point, p
Viewer, v
Dvp
x
I 0 e d x
k ( )
e
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
I 0 e d x
k ( )
e
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
I 0 e d x
k ( )
e
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
I 0 e d x
k ( )
e
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
I 0 e d x
k ( )
e
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
Dvp
Dvp
0
I 0 e d x
k ( )
e dx
2
d
The Airlight Integral
: scattering coefficient of the medium
Point Source, s
Dsv
Surface Point, p
Viewer, v
Dvp
Dvp
Lairlight( , Dsv , Dvp , )
0
I 0 e d x
k ( )
e dx
2
d
The Airlight Integral
Dvp
Lairlight( , Dsv , Dvp , )
0
I 0
4
Dvp
0
I 0 e d x
k ( )
e dx
2
d
x Dsv cos
k arccos(
2
2
x
D
sv 2 xDsv cos
4D:
Dsv Dvp
e Dsv2 x 2 2 xDsv cos
x
) 2
e
dx
2
Dsv x 2 xDsv cos
We want:
- Low dimensional tabulation and cheap evaluation
- Interactively change physical parameters
The Airlight Model-Solution
Dvp
Lairlight( , Dsv , Dvp , )
0
I 0 e d x
k ( )
e dx
2
d
and D*
- combine Tsv and
- combine
4D:
Dsv Dvp
The Airlight Model-Solution
Dvp
Lairlight( , Dsv , Dvp , )
0
I 0 e d x
k ( )
e dx
2
d
4D:
Dsv Dvp
and D*
- combine Tsv and
- combine
A0 (Tsv , , )
lim1
exp[ A (T
1
sv
, ) tan ]d
lim2
2 I 0 eT cos
2Tsv2sin
sv
Tvp Tsv cos
Tsv sin
1
arctan
4 2
Tsv sin
The Airlight Model-Solution
Dvp
Lairlight( , Dsv , Dvp , )
0
I 0 e d x
k ( )
e dx
2
d
4D:
Dsv Dvp
and D*
- combine Tsv and
- combine
A0 (Tsv , , )
lim1
exp[ A (T
1
sv
, ) tan ]d
lim2
v
F (u, v) exp[ u tan ]d
0
2D
Special Function F
v
F (u, v) exp[ u tan ]d
0
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
2D:
A0 F (u1, v1 ) F (u2 , v2 )
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
Our Compact Airlight Formula
2D:
A0 F (u1, v1 ) F (u2 , v2 )
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
Our Compact Airlight Formula
2D:
A0 F (u1, v1 ) F (u2 , v2 )
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
Our Compact Airlight Formula
2D:
A0 F (u1, v1 ) F (u2 , v2 )
Compact 2D representation.
Real time cheap evaluation.
Arbitrarily change physical parameters.
Fully interactive
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
Viewer, v
nˆ
BRDF
Surface Point, p
Lambertian and Phong Spheres
Clear
Day
Lambertian
Foggy
Day
Phong=10
Phong=20
The Surface Radiance Model
Point Source, s
BRDF
Viewer, v
nˆ
Surface Point, p
2D : G0, Gn
1D function on
i : Lambertian, Phong
Lsurface Lairlight BRDF cos i di
2D: F
Video: Diffuse and Glossy Shading
Video clip 2
The Complete Model
Le
Tvp
Lsurface Lairlight
Surface Radiance Model
Airlight Model
2 Lookups G0 and Gn
2 Lookups
F
The Complete Model
Le
Image size
Tvp
Lsurface Lairlight
Surface Radiance Model
Airlight Model
2 Lookups G0 and Gn
2 Lookups
F
Lights
Terms to VS
approximate
the phase function
15 Million
1.9 Trillion
Texture lookups
4 S I N = 5 Million
Analytic expression
8 S I = 10 Million
Snap Shot of Shader Code
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;
}
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.
Dsv
Viewer, v
nˆ
Surface Point, p
Dvp
BRDF
Point Spread Function
Equidistant point sources
Scattering is essentially Point Spread Function (PSF).
[Narasimhan and Nayar 2003], [Premoze et al. 2004]…
Intensity
Input
Output
Angles
PSF
Complex Materials
Intensity
BRDF
Effective BRDF
with Scattering
Angles
PSF
Clear Day
Foggy Day
Environment Maps
Intensity
Lighting
Foggy Lighting
Angles
PSF
Clear Day
Foggy Day
PSF for Complex Lighting and Material
Video clip 4 and 5
Visual Effects and Performance Comparisons
Methods
Monte Carlo
Numerical
Simulation
Other
Analytic
Methods
Our Model
Shadows
Glows
Surface
shading
Complex
lighting&
materials
Real
Time
OpenGL
Like
Visual Effects and Performance Comparisons
Methods
Monte Carlo
Numerical
Simulation
Other
Analytic
Methods
Our Model
Shadows
Glows
Surface
shading
Complex
lighting&
materials
Real
Time
OpenGL
Like
Visual Effects and Performance Comparisons
Methods
Monte Carlo
Numerical
Simulation
Other
Analytic
Methods
Our Model
Shadows
Glows
Surface
shading
Complex
lighting&
materials
Real
Time
OpenGL
Like
Summary
An OpenGL-Like Practical Real-Time Rendering Technique:
Analytic Airlight Model
50fps
40fps
Summary
An OpenGL-Like Practical Real-Time Rendering Technique:
Analytic Airlight Model
Analytic Surface Radiance Model
40fps
50fps
Summary
An OpenGL-Like Practical Real-Time Rendering Technique:
Analytic Airlight Model
Analytic Surface Radiance Model
PSF for Complex Lighting and Natural Materials
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