Graphics Reference
In-Depth Information
So what about the normalization weight
W
? This is intimately tied up
with the sampling density of the particles. Let
V
be the volume associated
with each particle: you can think of it as the limit of a volume of space
divided by the number of particles contained within, for uniform sampling.
For example, if you initialize with eight particles per grid cell in a smoky
region, then
V
=Δ
x
3
/
8. We can estimate the total amount of smoke in
the simulation, i.e., the integral of smoke concentration over the simulation
volume, either from the particles as
S
total
≈
s
p
V
p
or from the grid as
s
i,j,k
Δ
x
3
.
S
total
≈
i,j,k
We now choose
W
so these two estimates are equal. For the recommended
trilinear hat kernel function
k
(or indeed, any other B-spline), the sum of
k
(
x
p
−
x
i,j,k
) over all grid points is exactly one, which nicely simplifies the
calculation:
s
i,j,k
Δ
x
3
=
i,j,k
k
(
x
p
−
x
i,j,k
)
W
Δ
x
3
s
p
p
i,j,k
⎛
⎝
i,j,k
⎞
=
p
Δ
x
3
W
⎠
s
p
k
(
x
p
−
x
i,j,k
)
=
p
Δ
x
3
W
s
p
.
Therefore, we take
W
=Δ
x
3
/V
, or more simply, the average number of
particles per grid cell.
We can of course get a little fancier and introduce a normalization
weight
W
p
per particle, tying into a non-uniform particle seeding. This
brings up the question of how to seed particles in the first place. There are
a lot of possibilities, and not necessarily any single best choice, but we will
outline one strategy.
On the initial frame, we use an initial grid-sampled smoke concentration
s
, and in grid cells where this is non-zero, add
W
particles with
s
p
-values
interpolated from the grid. Positioning them on a jittered grid works fine
for this. In subsequent time steps, each smoke emitter specifies a desired
number of new smoke particles per unit time in each grid cell,
r
i,j,k
,each