Convolution Web
Convolution Web
A Convolution-Based Algorithm
for Animated Water Waves
J. Loviscach
Abstract
A non-linear partial differential equation solver is too sophisticated for computer graphics applications if they are
only used to render effects like circular waves and ship wakes. We present an approach which simulates waves
through a convolution algorithm. It handles both gravity waves and capillary waves; the latter are often neglected
even though they dominate small-scale behavior. The algorithm can be integrated into a complete solution archi-
tecture: First, standard commercial 3-D software is used to prepare an animated scene with objects traveling on
a water surface. Based on the movements of these objects, waves are calculated and added as bump and displace-
ment maps to the 3-D model.
Categories and Subject Descriptors (according to ACM CCS): I.3.7 [Computer Graphics]: Three-Dimensional
Graphics and Realism—Animation
1. Introduction
Water waves are an everyday phenomenon and thus their
simulation makes for a natural research topic in computer
graphics. Despite all past efforts, both the analytical and nu-
merical treatment of a liquid’s motion still pose consider-
able challenges. Fluid motion is described by the continu-
ity equation plus the Navier-Stokes equations—a system of
three non-linear partial differential equations—in conjunc-
tion with surface conditions, which typically are non-linear
as well. However, a full-blown numerical solution of these
equations is rarely needed to generate realistically-looking
animated films.
Since the motion in the volume of the liquid remains in-
visible in most scenes, it is sufficient to model the surface Figure 1: A raindrop simulation by the proposed algorithm
of the liquid. Additionally, water is virtually incompressible, shows the characteristic multiple rings formed by the inter-
its viscosity can often be neglected, and non-linear effects play of capillary and gravity waves. The results of the simu-
stay small if the waves’ height is small when compared to lation have been used for a bump map and a caustics texture
their length. When using an approximate, linear system of in a rendering created with Cinema 4D XL. Compare with
partial differential equations, one arrives at the conclusion2 figure 3 for the height field.
that small-amplitude surface water waves on an flat infinite
ocean with infinite depth are composed of sinusodial waves
(x,t) 7→ cos(k · x − ω(k)t + φ),
k ∈ R2 the wave vector along the surface, ω(k) the corre-
2
where x ∈ R is the position on the plane of the ocean, sponding circular frequency, and φ ∈ R the phase. The cir-
c The Eurographics Association 2002.
cular frequency only depends on the wave number k = |k| Like in Huygen’s principle, this is the circular wave caused
and is given by by a disturbance at time 0 at the origin, observed after a time
r span of ∆t. In order to use this kernel with a lattice-based
T numerical approximation, it is necessary to introduce cutoffs
ω(k) = gk + k3 , (1)
ρ for long and short waves. These cutoffs have the additional
with gravity acceleration g, surface tension T , and mass den- benefit of eliminating the mathematical problems with this
sity ρ. Under normal circumstances, their values are g = expression.
9.8 kg m/s2 , T = 0.072 kg/s2 , and ρ = 1.0 · 103 kg/m3 . The convolution scheme allows to calculate each frame
The dispersion relation ω(k) causes a number of impor- without intermediate time steps. Sudden disturbances, such
tant visual effects: as a stone dropped into a pool, can be incorporated by alter-
ing ηt at the time t of this incident, for example by adding
• The phase velocity ω(k)/k reaches its minimum of a function to ηt which is zero outside the cross section of
23 cm/s at a wavelength of 17 mm. Shorter waves (cap- the stone. In order to model continuous disturbances such as
illary waves dominated by surface tension) as well as traveling ships, however, one has to integrate over the time-
longer waves (gravity waves) travel faster. Likewise, span ∆t.
the group velocity dω(k)/dk possesses a minimum of
We have developed a prototype system for water wave an-
18 cm/s. A stone thrown into deep water produces com-
imation with this algorithm. The solution is based on Maxon
plex ring waves where the innermost ring expands at this
Cinema 4D XL, but could use virtually any other commer-
speed. In contrast to this behavior of water surface waves,
cial 3-D software package. This program is used to model
waves of light or sound travel at a constant speed, re-
and animate a flat ocean and objects traveling on the wa-
gardless of their frequency. If water behaved this way, a
ter, which still is flat. These pictures are rendered black and
stone thrown into water would yield a single sharp circu-
white in a view form above and then fed into our special
lar wave.
add-on software. It computes the corresponding wave ele-
• A ship traveling at constant speed along a straight line on
vation fields, optionally separates the results into a blurred,
deep water leaves behind a Kelvin wake2 —a wedge with
low-pass version and a corresponding high-pass version. In
semiangle 19◦ . This angle is independent of the ship’s ve-
addition, the software calculates the caustics pattern on the
locity, once more in stark contrast to sound waves: The
ground. These parallel sequences of pictures are fed into the
Mach cone of a supersonic plane gets more pointed as the
3-D software as displacement maps, bump maps, and texture
speed of the aircraft increases.
maps for the final rendering—now including waves and seen
Therefore, an approach using the much simpler wave from an arbitrary point of view. The division into displace-
equation of sound and light often results in unrealistic behav- ment maps and bump maps allows for a relatively coarse
ior. Nonetheless, this equation is favored e. g. in computer tesselation resulting in short rendering times.
c The Eurographics Association 2002.
Loviscach / Water Waves
The next section outlines previous work done for simu- steps, a damping term has to be introduced. Taking a differ-
lating water waves in 3-D computer graphics. Section 3 de- ent road, Stam16 proposes an intrinsically stable algorithm
scribes our convolution-based algorithm for time evolution. for the full Navier-Stokes equations. It can be simplified us-
Section 4 explains how objects which move on the water sur- ing Fourier transform17 . However, the presented algorithm
face are incorporated into this approach. A discussion of the does not allow free boundaries such as water surfaces. Foster
results follows in section 5. The final section 6 closes with a and Fedkiw4 combine Stam’s solver with marker particles3
summary and an outlook on possible extensions. to trace the fluid surface.
Weimer and Warren19 note that certain multi-grid partial
2. Previous Work differential solvers can be formulated with help of vector
The first two major works about water wave animation subdivision operations. The method they describe assumes
rooted in physics have been published in 1986: Fournier and a slow flow, i. e. viscosity dominates inertial behavior, and is
Reeves5 as well as Peachey14 use wave trains with the shape therefore not well-suited for water simulation.
of a trochoid respectively an approximation to a trochoid
shape. Waves running onto a shore are subjected to refrac- 3. Time Evolution by Convolution
tion and therefore compressed. Gonzato7 carries the idea of
To treat the problem numerically, we discretize the elevation
“wave tracing” further to calculate refraction due to varying
field ηt to a finite lattice of size L × L with N × N points.
water depth and the diffraction at obstacles. Here, capillary
It consists of the (p∆x, q∆x) with p, q = 0, 1, . . . , N − 1 and
waves are introduced, even though they are simply modeled
∆x = L/(N − 1). In our experiments, N = 256 or, in extreme
by fractal noise. In their recent work, Gamito and Musgrave6
cases, 512 proved to be sufficiently large. The real part of
offer a more detailed theory of wave tracing.
the computed ηt will be delivered as a bump map and/or
Thon and Ghazanfarpour18 use wave spectra measured displacement map to the 3-D rendering software. Therefore,
e. g. from photographs to synthesize ocean waves. Using such maps will then consist of e. g. 256 × 256 pixels.
quite a different approach, Schneider and Westermann15
To calculate the elevation field in an animated film from
simulate waves using fractal noise and then render these in
one picture frame to the next, we use the time evolution
real time with light reflection, refraction, and caustics with
given by equation 2 with ∆t being the time between frames.
modern consumer graphics hardware.
The double integral is approximated using the double sum
Goss9 presents an particle-system algorithm tailored to
η̃t+∆t (p∆x, q∆x) = (4)
display ship wakes in real-time. Khan10 superimposes cir-
M−1 M−1
cular waves from points along a ship’s path to simulate its
wake.
(∆x)2 ∑ ∑ Φ∆t (r∆x, s∆x) ηt ((p − r)∆x, (q − s)∆x).
r=−M s=−M
To allow a more complete interaction of the water with Here, ηt is treated as zero outside of [0, L] × [0, L]. M mea-
disturbances as well as changing boundaries, there have been sures the half size of a sliding window which is used for the
several approaches based on partial differential equations. convolution. We use M = 40, so that the window contains
Kaas and Miller11 use a linearized model of a shallow wa- 80 × 80 lattice points. Instead of the ill-defined Ψ∆t of equa-
ter limit, which is equivalent to the wave equation of light tion 3 a regularized version Φ∆t is used. Especially, Φ∆t has
and sound. This is solved by a finite-difference-method. Re- to smoothly approach zero on the boundary of the sliding
cently, Layton and van de Panne12 have improved these ideas window (see below).
by incorporating non-linear advection.
The η̃t+∆t (p∆x, q∆x) resulting from equation (4) cannot
O’Brien and Hodgins13 model the water volume as an ar- be used directly, because the resulting waves would reflect
ray of square columns which exchange fluid. If the content strongly at the borders. This reflection can be suppressed re-
of a column moves upward faster than a threshold veloc- liably by cutting off the elevation field near the borders in
ity, their algorithm generates spray. To achieve real-time re- linear fashion:
sponse, Chen and Lobo1 replace the full three-dimensional
Navier-Stokes equations by the two-dimensionial version. ηt+∆t (p∆x, q∆x) = h(p) h(q) η̃t+∆t (p∆x, q∆x) (5)
The local pressure calculated in this manner is used to steer with
a three-dimensional height field which represents the water
p/M if p < M
surface.
h(p) := 1 if M ≤ p < N − M
Foster and Metaxas3 simulate solutions of the full Navier-
(N − 1 − p)/M if p ≥ N − M.
Stokes equations by using a voxel representation for the vol-
The resulting elevation field ηt+∆t will be used to calculate
ume and marker particles to trace the surface. Thanks to this
the next frame’s field ηt+2∆t , which in turn will serve as base
representation, their algorithm can produce e. g. breaking
for the succeeding one, etc.
waves and overturns. Surface tension is simulated by alter-
ing pressure gradients. To stabilize the method for large time The remaining task is to construct a regularized kernel
c The Eurographics Association 2002.
Loviscach / Water Waves
Figure 4: The convolution kernel Φ∆t used in calculating Secondly, the group velocity could be kept below vmax :=
4 ∆t by approximating the dispersion relation ω(k) of
3 M∆x
figure 3. The left picture shows the real part, the right picture
the imaginary part. For better comprehensibility, they are equation (1) with
enlarged in comparison to figure 3. r
T
gk + k2 a arctan(k/a) + b2 ,
ρ
A necessary property of Φ∆t (p∆x, q∆x) is that it tends to where
zero at the boundary of its domain, i. e. as p or q → −M
or M − 1. This cannot simply be implemented by multiply- 2ρv2max g
a := and b := .
ing with a cutoff function in x-space. Especially, one would πT 2vmax
c The Eurographics Association 2002.
Loviscach / Water Waves
4. Wave Generation by Swimming Objects The integral over s can be eliminated by partial integration:
Ships and other objects in the water surface generate waves ∆ηt+∆t (x) = (10)
through their motion and/or form changes. Our solution uses ZZ
(1) (2)
the motion between two picture frames to calculate how the d 2 y ft (x − y)Φ∆t,v (y) + ft+∆t (x − y)Φ∆t,v (y)
R2
elevation field ηt+∆t is to be altered for the following frame.
where
For each swimming object, an additive contribution is com-
d2k
ZZ
puted. (1)
Φ∆t,v (y) := exp i(k · y − ω(k)∆t)
2
R2 4π
For each object, we render the animation as a picture se- !
quence where the scene is shown from straight above, with e−iφ(k) + iφ(k) − 1
× −1 + iω(k)∆t
the ocean in black and the cross-section formed by the ob- φ(k)2
ject with the water surface in white. Such a rendering can
and
easily be obtained through Boolean operations available in
d2k
ZZ
standard 3-D animation software. (2)
Φ∆t,v (y) := exp(ik · y)
R2 4π2
!
eiφ(k) − iφ(k) − 1
× 1 + iω(k)∆t
φ(k)2
c The Eurographics Association 2002.
Loviscach / Water Waves
c The Eurographics Association 2002.
Loviscach / Water Waves
to equation (5) can cause instability. However, in our exper- 4. N. Foster and R. Fedkiw. Practical Animation of Liq-
iments such effects were not visible. uids. SIGGRAPH 2001 Conference Proceedings, An-
nual Conference Series, pp. 23–30, 2001. 3
Using the prototype software, a PC equipped with an
Pentium(R) -III processor running at 500 MHz computes 5. A. Fournier and T. Reeves. A Simple Model of Ocean
waves at a speed of 90 s per picture frame (L = 256, 2M = Waves. ACM Computer Graphics (Proc. of SIGGRAPH
80, one swimming object). The most time-intensive part of ’86), 20(4): 75–84, 1986. 3, 7
the algorithm consists in the convolution, even though we
6. M. N. Gamito and F. K. Musgrave. An Accurate Model
limit the evaluation of equation (10) to the neighborhood of
of Wave Refraction Over Shallow Water. Computers &
swimming objects and pre-compute Φ(1) and Φ(2) per object Graphics, in press. 3
for each frame. This pre-computation and the discretized cal-
culation of equation 3 could be implemented through a Fast 7. J. Ch. Gonzato and B. Le Saëc. On Modelling and Ren-
Fourier transform (FFT), but this would not yield an appre- dering Ocean Scenes—Diffraction, Surface Tracking
ciable acceleration. and Illumination. Journal of Visualization and Com-
puter Animation, 11(1):27–37, 2000. 3
c The Eurographics Association 2002.