Graphics Reference
In-Depth Information
displacement (notice
h
(
x, z, t
)andΔ
y
at
y
= 0 are identical), and now we
will add in the matching horizontal displacement. Just as with the height
field vertical displacement, we can evaluate this horizontal displacement on
a regular grid eciently with the FFT. Using the same process as we did
before with the height field to reduce it to the desired complex exponential
form, we get
n/
2
−
1
n/
2
−
1
X
ij
(
t
)
e
√
−
1(2
π
(
ip
+
jq
)
/n
)
,
Δ
x
pq
=
i
=
−n/
2+1
j
=
−n/
2+1
(13.18)
n/
2
−
1
n/
2
−
1
Z
ij
(
t
)
e
√
−
1(2
π
(
ip
+
jq
)
/n
)
,
Δ
z
pq
=
i
=
−n/
2+1
j
=
−n/
2+1
where the Fourier coecients are defined from
X
ij
(
t
)=
ω
k
t
)
πA
ij
i
kL
ω
k
t
)+
πA
−i,−j
i
kL
−
sin(
θ
ij
−
sin(
θ
−i,−j
−
1
πA
ij
i
kL
ω
k
t
)
,
+
√
−
ω
k
t
)+
πA
−i,−j
i
kL
cos(
θ
ij
−
cos(
θ
−i,−j
−
Z
ij
(
t
)=
ω
k
t
)
πA
ij
j
kL
ω
k
t
)+
πA
−i,−j
j
kL
−
sin(
θ
ij
−
sin(
θ
−i,−j
−
1
πA
ij
j
kL
ω
k
t
)
,
(13.19)
+
√
−
ω
k
t
)+
πA
−i,−j
j
kL
cos(
θ
ij
−
cos(
θ
−i,−j
−
or more simply,
k
k
Y
ij
(
t
)
.
(
X
ij
(
t
)
,Z
ij
(
t
)) =
√
−
1
(13.20)
These can be evaluated just like the vertical component Fourier coecients
Y
ij
(
t
), and for each component a call to the FFT library will then return
that component of the displacement evaluated on a regular grid. Adding
this fully 3D displacement to the coordinates of a regular grid at
y
=0gives
a much more convincing ocean surface. Tessendorf recommends including
a tunable choppiness parameter
λ
[0
,
1] to scale down the horizontal
displacement, allowing more range in the look:
λ
= 0 gives the soft look
of the pure height field solution, and
λ
= 1 the choppy full displacement
solution. We can go even further, in fact, getting a bit of a wind-blown look
by displacing in the horizontal direction of the wind, by a small amount
proportional to the height—more tunable parameters.
However, all the approximations we've taken to get to this point aren't
entirely self-consistent. If the amplitudes
A
ij
∈
aretoolargethefulldis-