Interactive Rendering of Atmospheric Scattering Effects Using Graphics Hardware Yoshinori Dobashi Hokkaido University Tsuyoshi Yamamoto Hokkaido University Tomoyuki Nishita Tokyo University Atmospheric Effects.

Download Report

Transcript Interactive Rendering of Atmospheric Scattering Effects Using Graphics Hardware Yoshinori Dobashi Hokkaido University Tsuyoshi Yamamoto Hokkaido University Tomoyuki Nishita Tokyo University Atmospheric Effects.

Interactive Rendering of
Atmospheric Scattering Effects
Using Graphics Hardware
Yoshinori Dobashi Hokkaido University
Tsuyoshi Yamamoto Hokkaido University
Tomoyuki Nishita
Tokyo University
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Motivation
• Real-time rendering of realistic images
• Atmospheric Scattering Effects
- scattering and absorption of light
due to small particles
- spotlights
- sunlight through windows
- earth’s atmosphere
requires long computation time
• Our Goal:
Real-time rendering of atmospheric effects
Atmospheric Effects
Previous Work
• Volume rendering
[e.g. Behrens98, Westermann98]
- use of voxels to store the intensity of light
- consuming texture memory for volume data
- difficult to capture the edges of shafts of light
edges of
spotlight
edges of
shadows
Atmospheric Effects
Previous Work
• 2D texture based approach [Dobashi01, Everitt99]
- use of shadow and projective texture mapping
- artifacts due to sampling errors
• Interleaved sampling [Keller01]
- a general and efficient solution to the sampling
problem
- not optimal for rendering atmospheric scattering
• Earth’s atmosphere
- no methods for real-time rendering of realistic images
Atmospheric Effects
Proposed Method
• Precise and efficient rendering of atmospheric
effects
• Rendering light beams
- point/infinite light sources
- uniform density of atmospheric particles
• Rendering earth’s atmosphere
- sky
- the earth viewed from space
- density decreases exponentially according to
the height from the ground
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Shading Model for Light Beams
Intensity at viewpoint
I s (l ) =
point source
0 Il (t, l )H (t ) g (t, l )dt
T
Ieye
viewpoint scattered light
Atmospheric Effects
Shading Model for Light Beams
Intensity at viewpoint
I s (l ) =
point light
0 Il (t, l )H (t ) g (t, l )dt
T
Il
Il (t , l ) :intensity of light
H (t ) :visibility function
t
P
g (t , l ):attenuation function
Is
viewpoint
Atmospheric Effects
Basic Idea [Dobashi00]
Intensity at viewpoint
I s (l ) =
0 Il (t, l )H (t ) g (t, l )dt =  Il (t, l ) H (t ) g (t, l )
T
n
k =1
computed
at lattices
point light
viewpoint
screen
sampling plane
Atmospheric Effects
Basic Idea [Dobashi00]
Intensity at viewpoint
I s (l ) =
0 Il (t, l )H (t ) g (t, l )dt =  Il (t, l ) H (t ) g (t, l )
n
T
k =1
light map
light map
point light
texture mapping
viewpoint
Atmospheric Effects
Basic Idea [Dobashi00]
Intensity at viewpoint
I s (l ) =
0 Il (t, l )H (t ) g (t, l )dt =  Il (t, l ) H (t ) g (t, l )
n
T
k =1
object
point light
shadow
mapping
viewpoint
Atmospheric Effects
Basic Idea [Dobashi00]
Intensity at viewpoint
I s (l ) =
0 Il (t, l )H (t ) g (t, l )dt =  Il (t, l ) H (t ) g (t, l )
n
T
k =1
object
point light
shadow
mapping
viewpoint
render sampling planes
with additive blending
Atmospheric Effects
Problems
• Accuracy  number of planes
number of lattice points
• Many planes/lattices for high quality image
- artifacts due to quantization errors
pseudo-contours
sampling errors
• quantization with 8 bit precision in most hardware
• accumulation of errors in proportion to number of
sampling planes
- increase in rendering time
• rendering time number of planes
number of lattice points
Atmospheric Effects
High Quality Rendering
point light
Intensity at viewpoint
I s (l ) =
0
T
Il (t , l ) H (t ) g (t , l )dt
Il
n
=  DIs (t , l )
k =1
DIs (tk , l ) =
t k + Dt
t
Il (t , l ) H (t ) g (t , l )dt
t
Is
Dt
P
k
Atmospheric Effects
High Quality Rendering
point light
Intensity at viewpoint
I s (l ) =
0
T
Il (t , l ) H (t ) g (t , l )dt
Il
n
=  DIs (t , l )
k =1
DIs (tk , l ) =
t k + Dt
t
t
Il (t , l ) H (t ) g (t , l )dt
Is
Dt
P
k
changes severely changes smoothly
const. in Dt
Atmospheric Effects
High Quality Rendering
point light
Intensity at viewpoint
I s (l ) =
0
T
Il (t , l ) H (t ) g (t , l )dt
Il
n
=  DIs (t , l )
k =1
DIs (tk , l ) =

t k + Dt
t
t
Il (t , l ) H (t ) g (t , l )dt
Is
Dt
P
k
t k + Dt
t
Il (t , l ) H (t )dt x
k
fh
t k + Dt
t
g (t , l )dt
k
fl
Atmospheric Effects
High Quality Rendering
point light
Intensity at viewpoint
I s (l ) =
0
T
Il (t , l ) H (t ) g (t , l )dt
Il =
1.0
n
=  DIs (t , l )
k =1
DIs (tk , l ) =

t k + Dt
t
Il (t , l ) H (t ) g (t , l )dt
Is
k
t k + Dt
t
Il (t , l ) H (t )dt x
k
fh
t k + Dt
t
scattered light
g (t , l )dt
k
fl
scattering component
Atmospheric Effects
High Quality Rendering
point light
Intensity at viewpoint
I s (l ) =
0
T
Il (t , l ) H (t ) g (t , l )dt
object
Il
n
=  DIs (t , l )
k =1
DIs (tk , l ) =

t k + Dt
t
Il (t , l ) H (t ) g (t , l )dt
Is
k
t k + Dt
t
Il (t , l ) H (t )dt x
k
t k + Dt
t
ratio of
reached light
g (t , l )dt
k
fh
fl
Illumination component scattering component
Atmospheric Effects
High Quality Rendering
• Scattering component
f l:
t k + Dt
t
g (t , l ) dt
k
- changes smoothly
- can be sampled at a large interval
use of texture to store pre-integrated values
• Illumination component fh:
t k + Dt
t
Il (t , l ) H (t ) dt
k
- includes visibility H and intensity distribution Il
- must be sampled at a short interval
sub-planes for accurate sampling
Atmospheric Effects
High Quality Rendering
• Scattering component
f l:
t k + Dt
t
g (t , l ) dt
k
- changes smoothly
- can be sampled at a large interval
use of texture to store pre-integrated values
• Illumination component fh:
t k + Dt
t
Il (t , l ) H (t ) dt
k
- includes visibility H and intensity distribution Il
- must be sampled at a short interval
sub-planes for accurate sampling
Atmospheric Effects
Textures for Scattering Component
fl (tk , l ) =
t k + Dt
t
rc F (a , l )
exp(- brc ( s + t ))
k
rc:density
b :attenuation ratio
tk :distance between
s
2
dt
(point light)
sampling
s
viewpoint and P
plane k
s :distance between
light and P’
t
:distance
between
t
a
viewpoint and P’
tk
:phase
function
F (a, l )
viewpoint
P
a :phase angle
point light
sampling
plane k+1
P’
Dt
Atmospheric Effects
Textures for Scattering Component
fl (tk , l ) =
t k + Dt
t
rc F (a , l )
exp(- brc ( s + t ))
k
- local coordinate UV
t = u'-u + t k
cos a = -u'/ s
s = u'
2
2+ 2
v
s
2
dt
(point light)
point light
sampling
plane k
s
U
sampling
plane k+1
Q
t
tk
a
viewpoint
P(u,
P v)
V
P’(u’,
P’ v)
Dt
Atmospheric Effects
Textures for Scattering Component
fl (u, v, l ) = ck q(u, v, l )
ck = exp(- brctk )
q(u, v, l ) =
u + Dt
u
constant for each
sampling plane
q(u, v, l ) :
U
rc F (cos-1(-u' / u'2 +v 2 ),l )
exp(-brc ( u'2 +v2 + u'-u))
x
du'
u '2 +v 2
ck :
point light
2D texture
sampling
plane k
s
sampling
plane k+1
Q
t
a
V
fl is evaluated precisely
t
k
reducing
quantization
P’(u’, v)
since texture stores
viewpoint
errors
P(u, v)
integrated values
Dt
Atmospheric Effects
High Quality Rendering
• Scattering component
f l:
t k + Dt
t
g (t , l ) dt
k
- changes smoothly
- can be sampled at a large interval
use of texture to store pre-integrated values
• Illumination component fh:
t k + Dt
t
Il (t , l ) H (t ) dt
k
- includes visibility H and intensity distribution Il
- must be sampled at a short interval
sub-planes for accurate sampling
Atmospheric Effects
Computation of Illumination Component
fh (tk , l ) =
t k + Dt
t
Il (t , l ) H (t )dt
light
k
- mk sub-planes between
sampling planes k and k+1
fh (tk , l ) =
1
mk
mk -1
 Il (rj , l ) H (r j )
j =0
sub-plane
rj : distance between viewpoint and
sub-plane j
- mk is determined adaptively
strong intensity
viewpoint
many sub-planes
sampling plane
Atmospheric Effects
Computation of Illumination Component
• Determining number of sub-planes, mk
1. shoot a ray
2. compute intensity of
scattered light
use textures for
scattering component
3. generate sub-planes in
proportion to intensity
Intensity of scattered light
mk
e
e :user-specified threshold
light
sub-plane
viewpoint
same contribution
plane
ofsampling
each sub-plane
to pixel intensity
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Rendering Earth’s Atmosphere
• No shadows of objects
• Rendering Sky
- extending method for
light beams
atmosphere
• Rendering the earth
viewed from space
viewpoint
earth
Atmospheric Effects
Rendering Earth’s Atmosphere
• No shadows of objects
• Rendering Sky
- extending method for
light beams
viewpoint
atmosphere
• Rendering the earth
viewed from space
- atmosphere is very thin
layer covering the earth
earth
Atmospheric Effects
Rendering Earth’s Atmosphere
• No shadows of objects
• Rendering Sky
- extending method for
light beams
viewpoint
atmosphere
• Rendering the earth
viewed from space
- atmosphere is very thin
layer covering the earth
earth
- use of sampling spheres
instead of sampling plane
sampling spheres
Atmospheric Effects
Rendering Earth’s Atmosphere
• No shadows of objects
• Rendering Sky
- extending method for
light beams
viewpoint
atmosphere
• Rendering the earth
viewed from space
- atmosphere is very thin
layer covering the earth
earth
- use of sampling spheres
instead of sampling plane
sampling spheres
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
0
T
Iv (l ) = Isun(l ) F (a , l ) r (t , l ) gl ( s, l ) g v (t , l )dt
Isun
Ps
Isun(l ) : intensity of sunlight
s
F (a , l ): phase function
r (t , l ) : density of particles
g l (s, l ) : attenuation ratio between
Ps and P
P
atmosphere
t
Pv
viewpoint
a
earth
gv( t , l ) : attenuation ratio between
P and Pv
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
0
T
Iv (l ) = Isun(l ) F (a , l ) r (t , l ) gl ( s, l ) g v (t , l )dt
Isun(l ) : intensity of sunlight
atmosphere
F (a , l ): phase function
Pv
viewpoint
r (t , l ) : density of particles
g v (t , l ) : attenuation ratio between
Ps and P
earth
gl ( s, l ) : attenuation ratio between
P and Pv
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
Iv (l ) = Isun(l )
n
k -1
 F(a , l ) R(t ) gl (s, l ) Dgv (t j , l )
k =1
Isun
j =1
Isun(l ) : intensity of sunlight
k+1
k
g l (s, l ) : attenuation ratio between
Ps and P
F (a , l ): phase function
Ps
atmosphere
Pv
viewpoint
P
earth
Dg v (tk , l ) : attenuation between
sampling planes k and k+1
R(t) : cumulative density of
particles between sampling
planes k and k+1
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
Iv (l ) = Isun(l )
n
k -1
k =1
j =1
 F(a , l ) R(t ) gl (s, l ) Dgv (t j , l )
• Algorithm
• create textures of gl , Dgv , R
• for k = n to 1, repeat:
- map gl , Dgv , R textures
onto sampling plane k
Pv
viewpoint
earth
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
Iv (l ) = Isun(l )
n
k -1
k =1
j =1
 F(a , l ) R(t ) gl (s, l ) Dgv (t j , l )
• Algorithm
• create textures of gl , Dgv , R
• for k = n to 1, repeat:
- map gl , Dgv , R textures
onto sampling plane k
- compute IsunF at lattice points
Pv
viewpoint
earth
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
Iv (l ) = Isun(l )
n
k -1
k =1
j =1
 F(a , l ) R(t ) gl (s, l ) Dgv (t j , l )
• Algorithm
• create textures of gl , Dgv , R
Pv
viewpoint
• for k = n to 1, repeat:
- map gl , Dgv , R textures
earth
onto sampling plane k
- compute IsunF at lattice points
- draw plane with blending:
FB = FB x Dgv + F x R x gl (FB: frame buffer)
attenuation
intensity of scattered light
Atmospheric Effects
Rendering Sky
• Intensity at viewpoint
Iv (l ) = Isun(l )
n
k -1
k =1
j =1
 F(a , l ) R(t ) gl (s, l ) Dgv (t j , l )
• Algorithm
• create textures of gl , Dgv , R
Pv
viewpoint
• for k = n to 1, repeat:
- map gl , Dgv , R textures
earth
onto sampling plane k
- compute IsunF at lattice points
- draw plane with blending:
FB = FB x Dgv + F x R x gl (FB: frame buffer)
attenuation
intensity of scattered light
Atmospheric Effects
Rendering Sky
• Textures of gl, Dgv , R
gl ( PPs , l ) = exp(-
0
PPs
b (l ) r (l )dl )
Isun
Ps
b : extinction coefficient (constant)
s
r : density of particles
r (h) = exp(- ah) (a: const)
atmosphere
Pv
viewpoint
P
h
earth
Atmospheric Effects
Rendering Sky
• Textures of gl, Dgv , R
gl ( PPs , l ) = exp(-
0
PPs
b (l ) r (l )dl )
Isun
Ps
b : extinction coefficient (constant)
r : density of particles
r (h) = exp(- ah) (a: const)
atmosphere
ql
s
Pv
viewpoint
P
h
gl ( PPs , l )  gl (h,q l , l )
earth
Atmospheric Effects
Rendering Sky
• Textures of gl, Dgv , R
gl ( PPs , l ) = exp(-
0
PPs
b (l ) r (l )dl )
Isun
Ps
b : extinction coefficient (constant)
r : density of particles
r (h) = exp(- ah) (a: const)
atmosphere
qv
Pv
viewpoint
P
h
gl ( PPs , l )  gl (h,q l , l )
earth
Dg v ( PPv , l )  Dg v (h,q v , l )
R( PPv , l )  R(h,q v , l )
store as 2D textures
Atmospheric Effects
Overview
• Introduction
- motivation
- previous work
• Rendering Light Beams
- basic Idea
- problems
- high quality rendering
• Rendering the Earth’s Atmosphere
- rendering sky
- rendering the earth viewed from space
• Results
• Conclusion
Atmospheric Effects
Experimental Results
previous method
#planes: 40
mesh: 60x60
previous method
proposed method
#planes: 160
#planes: 30
mesh: 60x60 #sub-planes: 120 (ave.)
mesh: 10x10
computer: Athlon 1.7GHz, GeForce3
Atmospheric Effects
Experimental Results
method
previous
interleaved
[Keller01] proposed ray-tracing
result
# of planes
(subplanes)
mesh
time
40
160
23 (174)
60x90
10x15
10x15
0.13 [sec.] 0.12 [sec.] 0.08 [sec.]
29 [sec.]
Image size: 300x450 computer: Athlon 1.7GHz, GeForce3
Atmospheric Effects
Experimental Results
method
previous
interleaved
[Keller01] proposed ray-tracing
result
# of planes
(subplanes)
mesh
time
40
160
23 (174)
60x90
10x15
10x15
0.13 [sec.] 0.12 [sec.] 0.08 [sec.]
29 [sec.]
Image size: 300x450 computer: Athlon 1.7GHz, GeForce3
Atmospheric Effects
Results
sampling plane: 9
sub-plane:309
time: 0.32 [sec.]
sampling plane: 30
sub-plane:263
time: 0.12 [sec.]
Image size: 720x480 computer: Athlon 1.7GHz, GeForce3
Atmospheric Effects
Results
sampling plane: 100(sky)
30(shaft)
sub-plane:135
sampling sphere: 10
time: 0.06 [sec.]
time: 0.16 [sec.]
Image size: 720x480 computer: Athlon 1.7GHz, GeForce3
Atmospheric Effects
DEMO
• Real-time Animation Using Note PC
• Pentium III (1.2 GHz)
• Nvidia GeForce 2 Go
Atmospheric Effects
Conclusion
• Fast rendering of atmospheric effects
• Rendering of light beams
- 2D textures to store intensities of scattered light
- sub-planes for precise sampling of shadows
• Extension to rendering earth’s atmosphere
- rendering of sky
- rendering of earth viewed from space
Atmospheric Effects