2
M
o
T
e
Fra
n
Sun
d
Pre
g
day,
real
shy
for
m
laye
r
Fi
gu
Lini
n
2
o
delin
g
e
chniqu
n
k Kane
d
og Software
,
g
enerated sk
y
or games w
h
3D objects,
a
away from,
b
m
ance. This
g
r
s,
t
he simul
a
u
re 2.1. Volu
m
n
g SDK, court
e
g
,Lighti
esfor
V
,
LL
C
y
box texture
s
h
ere the cam
e
a
s shown in
F
b
ut techniqu
e
g
em presents
a
tion of ligh
t
m
etric clouds a
t
e
sy of Sundog
S
ng,an
d
V
olum
e
s
aren’t suffi
c
e
ra may app
r
F
igure 2.1, is
e
s exist to p
r
an overview
t
transport
w
t
dusk rendere
S
oftware, LLC
.
d
Rend
e
e
tricCl
o
c
ient for ga
m
r
oach the clo
u
a challengi
n
r
oduce realis
t
of the proce
d
w
ithin a clou
d
e
d using splatt
i
C
.)
e
ring
o
uds
m
es with var
y
uds. Renderi
n
n
g task that
m
t
ic results wi
t
d
ural genera
t
d
, and sever
a
i
ng. (
I
mage fr
o
y
ing times of
n
g clouds as
m
any engines
t
h good per-
t
ion of cloud
a
l volumetric
o
m the Silver-
21
22 2.Modeling,Lighti ng,andRenderingTechniquesforVolumetricClouds
rendering techniques that may be used to produce realistically lit, volumetric
clouds that respond to changes in lighting conditions and grow over time.
2.1ModelingCloudFormation
Before we render a cloud, we need to know its size, shape, and position. A scene
may contain hundreds of clouds. While requiring a level designer to manually
place and shape each one maximizes artistic control, achieving realistic results in
this manner is time-consuming and challenging. Fortunately, procedural tech-
niques exist to model the size, shape, and position of clouds within a cloud layer.
A designer may simply define a bounding region for clouds of a specific type and
let the simulation handle the rest.
GrowingCloudswithCellularAutomata
While you could attempt to simulate the growth of clouds using fluid dynamics,
doing this at the scale of an entire cloud layer would be slow and overly complex
(although it has been done [Kajiya and Herzen 1984].) Clouds are complex natu-
ral phenomena, and attempting a rigorous physical simulation of their growth and
the transport of light within them is computationally prohibitive. Rather, we seek
techniques that produce results consistent with a viewer’s expectations of what a
cloud should look like, without overthinking the underlying physical properties.
One such shortcut is the use of cellular automata to grow clouds. You might
remember cellular automata from the game Life, where very simple rules about a
virtual cell’s neighbors can produce complex colonies of cells that grow and
shrink over time. Work from Nagel and Raschke [1992] and Dobashi et al.
[2000] applying this same idea to the formation and growth of clouds is summa-
rized here.
There is some physical basis to this technique; in general, we know that
clouds form when a humid pocket of air rises and cools, causing a phase transi-
tion that turns its water vapor into water droplets. We also know that clouds tend
to form vertically and horizontally, but generally don’t grow downward.
We start by defining our cloud layer as an axis-aligned bounding box divided
into cubic regions that represent cells of air. Later, this three-dimensional array of
cells will become the voxels that are volumetrically rendered. Each cell consists
of three states, each represented by a single bit:
■
VAPOR_BIT, indicates whether the cell contains enough water vapor to form a
cloud.
Get Game Engine Gems 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.