LI Bo, CHEN Ge, TIAN Fenglin SHAO Baomin, and JI Pengbo
1) Department of Marine Technology, Ocean University of China, Engineering Research Center of Marine Information Technology, Ministry of Education, Qingdao 266100, P. R. China
2) Shandong Provincial Key Laboratory of Optical Astronomy and Solar Environment, Institute of Space Sciences, Shandong University, Weihai 264209, P. R. China
3) Institute of Oceanographic Instrumentation, Shandong Academy of Science, Qingdao 266001, P. R. China
GPU Accelerated Marine Data Visualization Method
LI Bo1),2), CHEN Ge1),*, TIAN Fenglin1), SHAO Baomin3), and JI Pengbo1)
1) Department of Marine Technology, Ocean University of China, Engineering Research Center of Marine Information Technology, Ministry of Education, Qingdao 266100, P. R. China
2) Shandong Provincial Key Laboratory of Optical Astronomy and Solar Environment, Institute of Space Sciences, Shandong University, Weihai 264209, P. R. China
3) Institute of Oceanographic Instrumentation, Shandong Academy of Science, Qingdao 266001, P. R. China
The study of marine data visualization is of great value. Marine data, due to its large scale, random variation and multiresolution in nature, are hard to be visualized and analyzed. Nowadays, constructing an ocean model and visualizing model results have become some of the most important research topics of ‘Digital Ocean’. In this paper, a spherical ray casting method is developed to improve the traditional ray-casting algorithm and to make efficient use of GPUs. Aiming at the ocean current data, a 3D view-dependent line integral convolution method is used, in which the spatial frequency is adapted according to the distance from a camera. The study is based on a 3D virtual reality and visualization engine, namely the VV-Ocean. Some interactive operations are also provided to highlight the interesting structures and the characteristics of volumetric data. Finally, the marine data gathered in the East China Sea are displayed and analyzed. The results show that the method meets the requirements of real-time and interactive rendering.
marine data; visualization techniques and methodologies; spherical ray casting; line integral convolution; multiquadric method; VV-Ocean
Marine data, which are volumetric data, contain a variety of information about a water body (e.g., seawater temperature, salinity, density, and current). Marine data, due to its large scale, random variation and multi-resolution in nature, are hard to be visualized and analyzed (Jerry, 2001; Claes, 2004). Moreover, people can not observe the internal characteristics and phenomena of the ocean directly and comprehensively. ‘Digital Ocean’, which emerged after ‘Digital Earth’, focuses on analyzing ocean phenomena and serves for ocean applications.‘Digital Earth’ is an information system including massive, multi-resolution, multi-temporal marine databases and analysis algorithms (Shi and Lei, 2011). Nowadays, constructing an ocean model and visualizing volumetric data have become some of the most important and critical research topics of ‘Digital Ocean’. The study of marine volumetric data visualization can be valuable in many other research areas (Coelho et al., 2004).
In this paper, a spherical ray casting method is developed to improve the traditional ray casting algorithm and to make efficient use of GPUs. Aiming at the current data, a 3D view-dependent line integral convolution method (LIC) is used, in which the spatial frequency is adapted according to the distance from the camera position. The study is based on a 3D virtual reality and visualization engine, namely the VV-Ocean. Some interactive operations are also provided to highlight the interesting structures and characteristics of volumetric data.
2.1 Related Work
Volume visualization, one of the most important fields of scientific visualization, is the process of generating meaningful and visual information on a two-dimensional image plane from three-dimensional datasets. It has been increasingly important in geographical information systems to improve the ocean modeling (Gonzato and Saec, 2000; Djurcilov et al., 2002) and the understanding of some natural phenomena like tropical cyclones. For the ocean modeling application, direct volume rendering techniques improve the analysis of ocean structures, allow the generation of visual information (e.g., seawater temperature, salinity, velocity, and mass) and provide more information than cross-section or planar maps.
The research on vector visualization has evolved very rapidly over the last two decades (Peng and Laramee, 2009). More recently, texture-based techniques have beenextended to the efficient, interactive visualization of vector fields on 2D curved manifolds (Weiskopf and Ertl, 2004; Li et al., 2006) and on 3D Cartesian domains (Weiskopf et al., 2001, 2007). In these recent studies, the high speed graphics hardware was used to accelerate the visualization. Another line of research addresses the issues of occlusion, visual clutter, and perception of depth and orientation for the flow visualization. For example, interactive clipping of 3D LIC volumes allows users to avoid occlusion problems (Rezk-Salama et al., 1999); selective and perception-oriented rendering can be applied to 3D LIC (Helgeland and Andreassen, 2004); limb darkening can be used to improve the perception of LIC lines (Interrante and Grosch, 1997). However, the feature extractions and visualizations are not sufficient enough to represent the changes and patterns of actual current fields, for they are based on ideal or experimental data.
2.2 Existing Ocean Systems and Platforms
A variety of products and platforms exist for marine data study in virtual earth sphere environment, which include Google Ocean, WorldWind of US National Aeronautics Space Administration, MyOcean of European Union, IOcean of State Oceanic Administration of China, and EV-Globe by EarthView Image Incorporated (Zhang et al., 2011; Chen et al., 2012a). These platforms provide a virtual three-dimensional spherical model of the earth and have the capability to simulate global or regional natural elements and phenomena from sea surface to bottom, but have shortcomings in the field of 3D visualization and in constructing and representing ocean volumetric data.
In addition to the generic features of 3D graphics rendering engine such as object oriented design, good expansibility and scene graph management, there are two special design goals for ocean applications in VV-Ocean as follows (Chen et al., 2012b):
1) Generating a high-fidelity VR ocean and land environment
The VV-Ocean engine uses global land and ocean DEM data to build a virtual earth sphere environment, which contains both land and seafloor terrain generated by the GPU-Based Geometrical Clipmap method (Asirvatham and Hoppe, 2005). In VV-Ocean, a screen-subdivision algorithm is also developed to simulate global dynamical ocean surface.
2) Visualizing marine data in virtual ocean scenes
In VV-Ocean, real marine data can be visualized, relationships among ocean phenomena at three spatial levels of oceans (i.e., surface, interior and seabed) can be expressed, and rendering consequences can be switched between virtual ocean scenes and visualization effects. The advantages are that actual environments of marine data can be restored and that spatial distributions of ocean data can be expressed under the influence of ocean conditions, such as wind, waves and current.
4.1 Modeling Volumetric Data
The original data come from the observation networks of ocean buoys, in which current, salinity and temperature from sea surface to bottom are gathered. Most of these data are discrete, unevenly distributed and limited in space. Therefore it is necessary to resample and rebuild continuous volumetric data to make full use of the limited and scattered marine data. In dealing with volumetric data, three independent variables, x, y, and z are used to represent a point p=(x, y, z) in a 3D space. In mathematical terms, the modeling problem is to find a trivariate function, F(p)=F(x, y, z), that approximates the relationship implied by a collection of data values.
The problem of bivariate data has been studied extensively. Franke and Nielson described some solutions for this problem (Franke and Nielson, 1991). One of the most effective methods is the multiquadric method (Nielson et al., 1991), for which the modeling function is
In the case of interpolation, F(pi)=Fi(i=1, …, N) is required and the coefficients αiis computed by solving the N×N linear system of constraint equations:
The optimal choice of the constant R2is determined by experiment results. The multiquadric method easily generalizes to multivariate data because it depends only on the Euclidean distance, which extends naturally to higher dimension. The main drawback of the multiquadric method is that the size of volumetric data has to be less than 500. The error accumulation can influence the results for a larger volumetric size (Nielson and Tvedt, 1994). Therefore, a big data set is divided into several small data sets for the adoption of this method.
4.2 Spherical Ray Casting Algorithm Based on GPU
The traditional ray casting algorithm is realized in a cube, therefore its rendering results do not cling to the spherical surface of the earth. In this paper, a spherical ray casting method is proposed and the start and end points of each ray in the spherical coordinate system are calculated based on GPU (Fig.1a). In essence, the following steps are taken:
1) Bounding sphere generation. First a bounding box iscreated with its length, width, and height corresponding to the latitude, longitude, and depth ranges of marine data respectively. Then, at an equal interval of latitude, longitude and depth, this box is divided into many small cubes whose vertex coordinates can be computed by linear interpolation. Each face of cubes is subdivided into two triangles whose Geodetic Coordinates are transformed into XYZ coordinates. The coordinates and indexes of every point, after being inputted to the Vertex Buffer Object (VBO) and the Index Buffer Object (IBO) and being stored in video memory, are used in a shader program.
2) Entry point determination. In a vertex shader program, the front faces of the volume bounding box are rendered to a 2D RGB texture. 3D texture coordinates of each vertex are issued as per-vertex color and its texture coordinates transformed into spherical coordinates. The initial positions (start) of all casting rays are stored in this texture.
3) Ray direction determination. In a fragment shader program, the near intersection point M (Fig.1b) between a casting ray and the sphere is calculated, and then the normalized ray direction (dir) is computed.
Point V changes with the camera position and each frame should be reset while rendering. The position of point M can be obtained from depth buffer by front face culling. The positions of points M and N can be calculated by simple additions:
Thus the coordinates of points M and N can be obtained using Eqs. (3) and (5).
4) Ray traversal and early ray termination. The value of volume data along with the ray direction and the accumulated color of every pixel on the screen can be calculated (Fig.2b). A casting ray can be expressed as:
Fig.1 (a) Intersections between a ray and the sphere. (b) Calculation of the spherical coordinates of intersections.
Fig.2 Rendering results of (a) Traditional ray casting method and (b) Spherical ray casting method with the same marine data.
where N is the number of steps, n is the index of N, δ is the step size, r(n) is the Nth sampled point of the casting ray. Therefore a newly sampled point r(n) is obtained as the casting ray walks one step forward along the ray di-rection. By using the coordinate of the sampled point, the property value from the 3D volumetric data texture is obtained. Then the respective color and opacity of this point are found in a transfer function (2D texture). Following this, the next point r(n+1) is calculated. This process is repeated for the calculations of N points. At each sample of volumetric data we blend the current contribution with the contribution that has been accumulated up to this position, until the current ray has already left the volume bounding box(i.e., when n>N)or the accumulated opacity value has become 1.
With the same marine data, the rendering results of the traditional ray casting method and the spherical ray casting method are shown in Figs.2a and 2b, respectively. From Fig.2 it can be seen that the spherical rendering method gives more accurate rendering results and shows graphical improvements.
4.3 View-Dependent 3D Line Integral Convolution
The 3D LIC algorithm takes as input a 3D white noise texture N, which is the same size as the vector field, and the input at each texel with a 1D filter kernel K defined along the local streamline is convoluted in the 3D flow field.
The LIC function value (Cabral and Leedom, 1993) can be computed at position r as
The function ρ is also regarded as a material density that is subsequently visualized by volume rendering. The input noise is denoted N. The filter kernel k(s) has support [-Ls, Le]. Usually, a low-pass filter such as a tent function or a Gaussian function is used. The convolution is performed along the streamline σ(s) that is parameterized by the arc length s. The streamline is obtained by particle tracing in the vector field v, i.e., by solving the ordinary differential equation:
The initial condition is σ(s0)=r. The curve is reparameterized by transforming the parameterization according to ξ to the arc-length parameterization according to s. If the vector field is normalized to the unit length, ||v(p)||=1, the arc-length parameterization is automatically guaranteed.
After perspective projection a constant spatial frequency of the noise in object space would lead to a varying spatial frequency on the image plane. To compensate for the effect of perspective foreshortening, an object-space noise model is used with the spatial frequency adapted according to the distance from the camera (Falk and Weiskopf, 2008). It is assumed that 3D noise N'(r) can be separated into a sum of octave spectral bands Ni(r):
According to the Cranley-Patterson rotation (Cranley and Patterson, 1976), different noise functions can be derived from the same template noise by random shifts. Various spectral scales are accommodated by a scaling of spatial parameters. A spectral band can then be computed according to
using a single noise template Nband(r) and a random shift Δri. Furthermore, it is assumed that the view- dependent noise filtering is narrow-banded and picks out only two neighboring spectral bands. Similar to MIP mapping, the filtered noise is calculated as
The rendering results of the 3DLIC method are shown in Fig.3a, while Fig.3b shows the cutting results after applying a clipping section in any direction.
Fig.3 Rendering results using (a) the 3DLIC method and (b) a clipping section in any direction.
In this study, the used data are stored as a NC (Network Common Data Format) file. The data were collected in the East China Sea, and the domain has a longitude range from 117.04? to 131.96? and a latitude range from 23.50? to 41.25? with a spatial resolution of 0.0825 degree. The time interval of the data collection is 7.2 h. The computer storage space of the marine data is about 400 M.
First, the multiquadric interpolation method is used to generate even volumetric data. Then the spherical ray casting method is used to visualize marine variables in a spherical earth environment. The rendering results of temperature and salinity at the initial time (t=0) are shown in Fig.4. The temperature ranges from -3.69℃ to 23.84℃and increases from high latitude to low latitude. With the increase of water depth, the temperature decreases gradually. The salinity ranges from 18 to 34.91 and is lower near the coast because of fresh water inflows.
In order to examine the temporal differences, the differences between two neighboring times in the same spatial location were computed and visualized (Fig.5). The temporal changes in temperature and salinity are small, mostly in the range of [0.2℃, 1.0℃] and [0.02, 0.12], respectively, and the greater differences appear in the middle-lower part of the East China Sea.
Fig.4 The rendering results of temperature in a spherical earth environment at the initial time (t=0).
Fig.5 The rendering results of temperature differences (a) and salinity differences (b) between time points 1 and 2.
To calculate the correlation between temperature and salinity, temperature (Vt) and salinity (Vs) are first normalized as Ntand Ns:
where Tmax, Tmin, Smaxand Sminare the maximum and minimum temperature and salinity at one time point, respectively. Then the difference Dtsbetween Nsand Ntis calculated as follows,
The value of Dtsis between 0 and 1 and a larger Dtscorresponds to a closer correlation. Fig.6 shows a strong correlation between temperature and salinity with Dtsmostly larger than 0.65.
The rendering results of a flow field are shown in Fig.7. Vertical velocity (W) in the field is much smaller than horizontal velocity (U&V), and it is not included in the original marine data. The parameters in the 3DLIC method, such as step size, step number, sampling frequency of noise and transfer function, can be changed.
The visualizations of marine data were run on a Windows XP machine with a Pentium4 CPU (2.53 GHz) and a NIVIDA GeForce GTS 450 video card (1.0 GB memory). The traditional and spherical ray casting methods were tested, and the interactive clipping method was used to cut off selected parts of the rendering results. Table 1 shows the comparisons of the rendering performance between the two methods.
Table 1 shows that the frame rate is 42 by the spherical ray casting method, which can meet users’ requirements of being real-time and interactive. However, the rendering speed by the spherical ray casting method is lower than the traditional method with a frame rate of 70. For theprocesses of coordinate transformations and bounding sphere generation, the spherical ray casting method requires more computations than the traditional method. Although the processes of ray casting and color accumulating demand a large number of computations, they take less time than a traditional ray casting method because both of the processes are realized in GPU. Moreover, the processes of generating and updating bounding surface cost more handling time for they are realized in CPU.
The ray casting method does not build the shape model of marine data, or generate any intermediate primitives such as triangle mesh. For this reason, the rendering efficiency depends on the number (screen resolution) and step size of casting rays, not on the size of marine data. With this method, the high resolution marine data can be divided into several parts for displaying, which can satisfy the users’ requirements and keep high rendering efficiency.
Fig.6 Rendering results of the correlation between temperature and salinity at time points 1 and 2 (a and b).
Fig.7 Rendering results of a flow field by the 3DLIC method. The spatial frequency increases from (a) to (c) with the distance increased from the camera.
Table1 Comparisons between traditional and spherical ray casting methods
Based on a 3D ocean virtual reality and visualization engine, VV-Ocean, a spherical visualization method is proposed for ocean volumetric data in this study. The spatial frequency is adapted according to the distance from a camera by a view-dependent 3D line integral convolution method. The implementation of the visualization method seeks to make efficient use of GPUs.
No longer content with simply expressing marine data, people want to use them to analyze and forecast marine phenomena nowadays (Chang et al., 2007). In future work, spatiotemporal analysis methods and data mining theories will be applied to discover patterns in large marine data sets involving methods at the intersection of artificial intelligence, machine learning, statistics, and database systems. Furthermore, other visualization methods of unsteady flow could be investigated such as that for pathlines or streaklines. And specific techniques forlarge-data visualization could be included, for example, scaling the rendering performance by parallelization on GPU clusters or employing out-of-core methods and data streaming from disk. Finally, we will investigate specif i c interaction techniques and user interfaces which allow us to model clip geometries effectively.
This research was supported by the Natural Science Foundation of China under Project 41076115, the Global Change Research Program of China under project 2012CB955603, and the Public Science and Technology Research Funds of the Ocean under project 201005019.
Aristizabal, M., Congote, J., Segura, A., Moreno, A., Arregui, H., and Ruiz, O. E., 2012. Hardware-accelerated web visualization of vector fields–case study in oceanic currents. In: Proceedings of GRAPP/IVAPP, 759-763.
Asirvatham, A., and Hoppe, H., 2005. Terrain rendering using GPU-based geometry clipmaps. GPU Gems, 2: 27-45.
Cabral, B., and Leedom, L. C., 1993. Imaging vector fields using lineIntegral convolution. ACM SIGGRAPH (Special Interest Group on Computer Graphics), 1993, 263-270.
Chang, R., Ghoniem, M., Kosara, R., Ribarsky, W., Yang, J., Suma, E., Ziemkiewicz, C., Kern, D., and Sudjianto, A., 2007. WireVis: Visualization of categorical, time-varying data from financial transactions. In: Proceedings of IEEE VAST, 155-162.
Chen, G., Li, B., Tian, F. L., Ji, P. B., and Li, W. Q., 2012a. Design and implementation of a 3D ocean virtual reality and visualization engine. Journal of Ocean University of China, 11 (4): 481-487.
Chen, G., Li, W. Q., Kong, Q. Q., Liu, S. X., Lv, C. J., and Tian, F. L., 2012b. Recent progress of marine geographic information system in China: A review for 2006 –2010. Journal of Ocean University of China, 11 (1): 18-24.
Claes, J., 2004. Real time water rendering. Master thesis. Department of Computer Science, Lund University.
Coelho, A., Nascimento, M., Bentes, C., de Castro, M. C. S., and Farias, R., 2004. Parallel volume rendering for ocean visualization in a cluster of PCS. In: Proceeding of VI Brazilian Symposium on Geoinformatics, Campos do Jord?o, S?o Paulo, Brazil, 22-24.
Cranley, R., and Patterson, T., 1976. Randomization of number theoretic methods for multiple integration. SIAM Journal on Numerical Analysis, 13: 904-914.
Djurcilov, S., Kim, K., Lermusiaux, P. F. J., and Pang, A., 2002. Visualizing scalar volumetric data with uncertainty. Computers and Graphics, 2 (26): 239-248.
Falk, M., and Weiskopf, D., 2008. Output-sensitive 3D line integral convolution. IEEE Transactions on Visualization and Computer Graphics, 14 (4): 820-834.
Franke, R., and Nielson, G., 1991. Scattered Data Interpolation and Application: A Tutorial and Survey. Geometric Modeling Computer Graphics–Systems and Applications, Springer Berlin Heidelberg, 131-160.
Gonzato, J. C., and Saec, B. L., 2000. On modeling and rendering ocean scenes. Journal of Visualisation and Computer Animation, 11 (1): 27-37.
Helgeland, A., and Andreassen, O., 2004. Visualization of vector fields using seed LIC and volume rendering. IEEE Transactions on Visualization and Computer Graphics, 10 (6): 673-682.
Interrante, V., and Grosch, C., 1997. Strategies for effectively visualizing 3D flow with volume LIC. Proceedings of the 8th conference on Visualization, 421-424.
Jerry, T., 2001. Simulating ocean water. ACM SIGGRAPH (Special Interest Group on Computer Graphics) 2001 Course Notes, Los Angeles, http://home1.get.net/tssndrf/.
Li, G. S., Tricoche, X., and Hansen, C., 2006. GPUFLIC: Interactive and accurate dense visualization of unsteady flows. Proceeding of Eurographics/IEEE-VGTC Symposium on Visualization (Eurovis ’06), Lisboa, Portugal, 29-34.
Nielson, G., Thomas, A., Hamann, F., and Lane, D., 1991. Visualizing and modeling scattered multivariate data. IEEE Computer Graphics and Applications, 11 (3): 47-55.
Nielson, G., and Tvedt, J., 1994. Comparing Methods of Interpolation Scattered Volumetric Data. State of the art in computer graphics. Springer-Verlag New York, Inc. Secaucus, NJ, USA, 67-86.
Peng, Z., and Laramee, R. S., 2009. Higher dimensional vector field visualization: A survey. In: Proceedings of TPCG, 149-163.
Rezk-Salama, C., Hastreiter, P., Teitzel, C., and Ertl, T., 1999. Interactive exploration of volume line integral convolution based on 3D-texture mapping. Proceedings of the Conference on Visualization, 233-240.
Shi, S. X., and Lei, B., 2011. Theory and Practice on China Digital Ocean. Ocean Press, Beijing, 80-100.
Weiskopf, D., and Ertl, T., 2004. A hybrid Physical/device-space approach for spatio-temporally coherent interactive texture advection on curved surfaces. Proceedings of Graphics Interface, 263-270.
Weiskopf, D., Hopf, M., and Ertl, T., 2001. Hardware- accelerated visualization of Time-varying 2D and 3D vector fields by texture advection via programmable per-pixel operations. Proceedings of the Vision Modeling and Visualization Conference, 439-446.
Weiskopf, D., Schafhitzel, T., and Ertl, T., 2007. Texture-based visualization of unsteady 3D flow by real-time advection and volumetric illumination. IEEE Transactions on Visualization and Computer Graphics, 13 (3): 569-582.
Zhang, F., Li, H. Q., Liu, J., and Li, S. H., 2011. Research and realization of visual digital ocean system. Marine Science Bulletin, 13 (1): 87-96.
(Edited by Xie Jun)
(Received February 19, 2013; revised April 17, 2013; accepted August 25, 2014)
? Ocean University of China, Science Press and Springer-Verlag Berlin Heidelberg 2014
* Corresponding author. Tel: 0086-532-66781265
E-mail: gechen@ouc.edu.cn
Journal of Ocean University of China2014年6期