Documente Academic
Documente Profesional
Documente Cultură
Vol:56 2011-08-24
Keywords—Interactive wave, ocean wave, wind effect, where (x,y) is a point coordinate on the wave surface, t is time
multithread vector and
(x,y,t) is the height at the point. aij ωi ki represent
International Science Index 56, 2011 waset.org/publications/8374
221
World Academy of Science, Engineering and Technology
Vol:56 2011-08-24
m , (8) Define the parameters
and the deflection angle between the wave and the wind &
direction is: Calculate the functions
j
( j 1) (1 j m) . (9) Signal the threads to begin
2 Thread 1
calculateing the heights of the
According to [8], to create several types of the deep ocean vertices
Thread 2
waves, the wave parameter values are recommended as
follows: the wind speed, U, varies from 0.55 ~ 20; the Thread …
frequency ranges, , are from 0.2 ~ 6; and the frequency
Thread n
interval,
is at 0.1, 0.2 and 0.4.
wait till threads finish
III. ADDING THE WIND MODEL
From (3), at S()1 the frequency range, the wind direction
and the wind speed are 1 min - 1 max ,1p and U1, respectively. End
At S()2, define 2 min - 2 max ,2p and U2 instead. These
parameters are used when the simulation time is at the point t1- Fig. 2 Flowchart of the multithreading
t2. The effects of the wind can be calculated from the
frequency range min - max as follows:
f (t) Another flowchart (fig.2) shows how the threads work
max 1max 2 max 1max . (10)
U 2 U1 simultaneously.
f (t)
min 1min 1min 2 min . (11)
U 2 U1
222
World Academy of Science, Engineering and Technology
Vol:56 2011-08-24
Adjust
…
Adjust Adjust
heights of heights of Wait till all Wait till all Wait till all
heights of threads finish threads finish threads finish
vertices vertices vertices the Calculation the Calculation the Calculation
No No No
International Science Index 56, 2011 waset.org/publications/8374
6) After gaining the height, use Vertex Buffer Object End End End
technique to draw the surface.
7) For the rendering process, calculate Normal vector of Fig. 4 Flowchart of multithreading technique to calculate
Normal vector for the rendering process
each surface and each vertex. Then, apply Phong model for the
shading. As this process was also time-consuming, we applied
Table I shows that this multithreading technique works well
multithreading technique for faster processing, as shown in fig.
on the calculation of the vertices heights but not on the normal
3.
map. This is because of the number of the heights is much
After all these processes, we would be able to simulate the
higher that that of the normal vectors. For the heights the
real-time interactive ocean wave.
higher the number of threads helping to calculate the height
map, the faster the processing time. Compared to the
V.EXPERIMENTAL RESULTS
calculation on the height of the 10,201 vertices, the normal
This research runs on a normal PC. The test bed is: map does not need as many calculations. The results indicate
that the processing times when applying the multithreading
CPU : Intel Core i7 720QM (1.6 – 2.8 GHz, 8 Cores) technique to calculate the normal map are not different from
GPU : NVIDIA GeForce GTX 260M those when not applying it, as shown in table 1. When the
Memory : DDR3 (1066 MHz) 4GB multithreading technique is applied, the OS and the CPU have
to control the thread switching, which slows the processing
This research created the ocean wave with 100 x 100 grids, time.
which equals to 101x101 vertices or 10,201 vertices. To
simulate the ocean wave, the height of each vertex has to be VI. SUMMARY
calculated, and thus it is very time-consuming to create one
The multithreading technique is very useful for the large
frame of wave on the screen. With the OpenGL techniques,
amount of calculations. It can be applied to accelerate the
Vertex array, Vertex Buffer Object Cube mapping and
processing of the CPU which has multi-cores. This research
multithreading technique, we can render the wave in real-time.
implements the multithreading technique to make the real-time
The results are shown in Table I.
rendering of the interactive ocean wave. This simulation
applies the cosine wave superimposition model, which requires
the huge amount of calculation of the height of all the vertices
223
World Academy of Science, Engineering and Technology
Vol:56 2011-08-24
to simulate the wave, so it is really suitable for the [8] X. Zhao, F.Li, S. Zhan and Z. Li, “Ocean wave simulation under wind
change effect,” in Proc. of the IEEE First International Conference on
multithreading technique.
Innovative Computing, Information and Control, 2006. pp. 26-29
The OpenGL techniques, Vertex array and Vertex Buffer
Object are applied to speed up the processing time. The
OpenGL Cube mapping technique is applied to make the TABLE I
reflection and refraction of the surface to make the scene more THE COMPARISON OF THE NUMBER OF THREADS AND THE FRAME-RATE
realistic while consuming a little of the CPU processing power. No. of No. of
The experimental results show that the wave from this threads threads
proposed method looks realistic enough as shown in fig. 5 and used to used to Usage of Frame per
real-time as the shown results in Table1. Our wave is good for calculate calculate CPU (%) second
applications such as games. To show that the wave is Height Normal
interactive, this research adds some objects, cube boxes, map map
floating on the water as shown in fig.6. We apply Archimedes’ 1 1 11 - 13 24
Principle of Buoyancy to simulate the floating objects on our 2 1 16 - 21 32
wave.
3 1 28 - 36 42
4 1 36 - 45 50
5 1 43 - 52 60
6 1 48 – 58 65
7 1 51 – 70 72
8 1 42 - 64 63
International Science Index 56, 2011 waset.org/publications/8374
1 2 12 - 13 24
1 3 12 – 14 24
1 4 12 – 15 25
1 5 13 – 15 25
1 6 13 – 15 25
Fig. 5 The wave with the frequency 9 and 9 degree, frame rate 56
1 7 13 – 15 25
1 8 11 – 14 22
2 2 18 – 22 33
4 4 40 – 49 56
7 7 62 – 78 81
REFERENCES
[1] N. Thurey, M. Muller-Fischer, S. Schirm, M Gross, IEEE 15th Pacific
Conference on Computer Graphics and Applications, 2007. pp. 39-46.
[2] C. Yuksel, D. H. House, J. Keyser, “ Wave particles,” ACM Transaction
on Graphics, Vol. 26, No. 3, Article 99, July 2007, pp.
[3] V. Mihalef, D. Metaxas, M. Sussman, “Animation and control of
breaking waves,” ACM SIGGRAPH Symposium on Computer
Animation, 2004, pp. 315-324.
[4] J. Tessendorf, “Simulating ocean water,” in Simulating Nature: Realistic
and Interactive Techniques, SIGGRAPH 2001, Course Notes 47.
[5] X. Ma, Z. Chen, G. Shi, “Real-Time ocean wave motion simulation
based on statistic model and GPU programming,” IEEE 2nd
International Conference on Information Science and Engineering
(ICISE), 2010, pp. 3876 – 3880.
[6] C. Wang, Z. Wang, J. Jin and Q. Peng, “Real-time simulation of ocean
wave based on cellular automata,” Submit to CAD/Graphics’2003
October, Macao, China.
[7] H. He, H. Liu, F. Zeng, G Yang, “A way to real-time ocean wave
simulation,” IEEE International Conference on Computer Graphics,
Imaging and Vision: New Trends, 2005. pp. 409-415.
224