ocean simulation
DESCRIPTION
Ocean Simulation. Nan Wang, Taibai Xu , Kuai Yu, Xiaofei Zhang. Introduction. CG water has been widely used in all levels of computer graphics, including movies, games, etc. - PowerPoint PPT PresentationTRANSCRIPT
Ocean Simulation
Nan Wang, Taibai Xu, Kuai Yu, Xiaofei Zhang
Introduction
CG water has been widely used in all levels of computer graphics, including movies, games, etc.
There are different approaches for simulating ocean surface: Navier-Stokes equation based methods, procedure noise based method (Perlin noise), and statistic model based method.
The method we used in our project is FFT based statistic model.
Gerstner Waves
In the Gerstner wave model, complex wave can be generated by summing a set of sine waves.
0 0 0( , ) : points on the ocean surface
: amplitude of wave (user defined)
: the travel direction of the wave (user defined)
: frequency of the wave
: phase
i
i
i
i
x x z
A
k
0 01
( / ) sin( )N
i i i i i ii
x x k k A k x t
01
cos( )N
i i i ii
y A k x t
Gerstner Waves (Cont.)
Gerstner Waves are rather limited because they are generally simple sum of sine waves horizontally and vertically.
An obvious drawback of this method is that the surface of ocean seems too periodic and uniform, thus the result of Gerstner Waves is not quite realistic.
Introducing in statistic model would help to avoid this drawback and generate more realistic waves.
Statistical Wave Model
In the project, we used the statistical wave model proposed by Jerry Tessendorf to generate the height field. In his model, wave height is a function of horizontal position and time
( , ) ( , ) exp( )k
h x t h k t ik x
0 0
0 0
:
( , ) : point of ocean surface
( , ) : fft-based representation of a wave height field
at the horizontal position ( , )
( , ) : a complex num
t time
x x z
h x t
x x z
h k t
ber that represents
a set of amplitude and phase
Statistical Wave Model (Cont.)
The above equation can be re-written in the following way:
With we could get a quite realistic ocean surface.
( , ) ( , ) (cos( ) sin( ))k
h x t h k t k x i k x
( , ) : the sum of sinusoids with complex,
time-dependent amplitudes:
( , ) : the amplitudes and phases of sinusoids
generated by the Phillips spectrum (talk later)
h x t
h k t
( , )h k t
Statistical Wave Models (Cont.)
The Phillips spectrum is a statistical model for wind-driven waves proposed by ocean graphic researchers.
0
*0
( , ) ( ) exp{ ( ) }
( ) exp{ ( ) } (1)
h k t h k i k t
h k i k t
0
1( ) ( ) ( ) (2)
2r i hh k i P k
22
4
exp( 1/ ( ) ) ˆ ˆ( ) | | (3)h
kLP k A k
k
*important: ( , ) ( , )h k t h k t
FFT Acceleration
The complexity of evaluation of exponential term can be reduced by applying FFT algorithm. Using the observation that (1) DFT equation can be considered as a set of point-wise values retrieved by a polynomial where complex n-th roots of unity were evaluated. (2) The computation of exponential terms can be accelerated using the flowing equation
Where w[N, n] denotes the n-th power of w(w = e2πi/N).Up to this point we can use divide and conquer to achieve O(nlogn) time complexity.
/2 1 /2 1
0 0
/2 1 /2 1
0 0
[ ] [2 ] [ / 2, ] [2 1] [ / 2, ] [ , ]
[2 ] [ / 2, ] [ , ] [2 1] [ / 2, ]
N N
n n
N N
n n
F m f n N nm f n N nm N m
f n N nm N m f n N nm
More on our project
We have made our program open source. The source code of our project is now available athttps://oceansimulation.googlecode.com/svn/trunk/
Please check out our video athttp://youtu.be/3v43Ucee0XA
Thank you!