Fast and dynamic generation of linear octrees for geological bodies ...

7 downloads 0 Views 779KB Size Report
Science China Press and Springer-Verlag Berlin Heidelberg 2010 ... School of Land Science and Technology, China University of Geosciences, Beijing 100083, ...
SCIENCE CHINA Earth Sciences • RESEARCH PAPER •

January 2010 Vol.53 No.1: 113–119 doi: 10.1007/s11430-009-0202-0

Fast and dynamic generation of linear octrees for geological bodies under hardware acceleration DENG Hao1,2, ZHANG LiQiang1*, MAO XianCheng2, MA JingTao3, KANG ZhiZhong4, PENG JunHuan4, RUI XiaoPing5 & LIU Liu1 1

State Key Laboratory of Remote Sensing Science, Beijing Normal University, Beijing 100875, China; School of Geoscience and Environmental Engineering, Central South University, Changsha 410083, China; 3 PTV America, Inc. 1145 Broadway Plaza Ste 605, Tacoma, WA 98407, USA; 4 Department of Geodesy and Geomatics, School of Land Science and Technology, China University of Geosciences, Beijing 100083, China; 5 College of Resources and Environment, Graduate University of Chinese Academy of Sciences, Beijing 100049, China 2

Received March 16, 2009; accepted July 13, 2009

In the application of 3D Geoscience Modeling, we often need to generate the volumetric representations of geological bodies from their surface representations. Linear octree, as an efficient and easily operated volumetric model, is widely used in 3D Geoscience Modeling. This paper proposes an algorithm for fast and dynamic generation of linear octrees of geological bodies from their surface models under hardware acceleration. The Z-buffers are used to determine the attributes of octants and voxels in a fast way, and a divide-and-conquer strategy is adopted. A stack structure is exploited to record the subdivision, which allows generating linear octrees dynamically. The algorithm avoids large-scale sorting process and bypasses the compression in linear octrees generation. Experimental results indicate its high efficiency in generating linear octrees for large-scale geologic bodies. 3D Geoscience Modeling, octree, geological body, hardware acceleration Citation:

Deng H, Zhang L Q, Mao X C, et al. Fast and dynamic generation of linear octrees for geological bodies under hardware acceleration. Sci China Earth Sci, 2010, 53: 113–119, doi: 10.1007/s11430-009-0202-0

In 3D Geoscience Modeling (3D GM), two ways are generally used to represent the geological bodies: surface representation and volumetric representation. Surface representation is easy to model and render. However, it is difficult to perform spatial analysis and rules out the possibility of representing the interior properties of geological bodies. In contrast, the volumetric representation can represent the interior properties of the 3D geological bodies whereas it is insensitive to the complexity of models. Based on this representation, some essential spatial analysis in 3D GM such as boolean and block operation can be performed efficiently. Because of their pros and cons, both represen*Corresponding author (email: [email protected]) © Science China Press and Springer-Verlag Berlin Heidelberg 2010

tations find their values in interactive applications of the so-called “Digital Mines”, where massive multi-source datasets exist, and the conversions need to be done on-thefly for more accurate and efficient representations. To increase the speed of the conversion from surface models to volumetric models, graphic hardware acceleration is usually exploited to accelerate voxelization [1, 2]. However, the voxelization for generating the high-resolution volumetric representations for large geological models often produces a large dataset in voxelization, and commonly its storage is, therefore, in the compressed form such as octree. Since the pointers of a conventional octree could demand a large quantity of storage, the linear octree [3] was introduced as an implicit representation of the octree withearth.scichina.com

www.springerlink.com

114

DENG Hao, et al.

Sci China Earth Sci

out losing any information, which only keeps the encoding of leaves. More importantly, it has high efficiency in such operations as boolean and block operation [4]. All these features make it suitable to be applied in networking environments for “Digital Mines”. In this paper, we propose a method to dynamically generate linear octree for geological bodies under hardware acceleration, in order to meet the needs of high-precision modeling for large-scale geological bodies and in interactive applications.

1 Generation of octrees and linear octrees For generating octrees from surface models, there are mainly two methods: the divide-and-conquer method and the filling method based on the connected component labeling techniques. The former consists of two general steps, which are brute-force procedures. The first step requires to perform face-to-face intersection between octants and surface models so as to test whether each octant belongs to the object [5]. To increase the speed of this step, polyhedral surface decomposition can be used to decompose surface models to reduce the number of faces [6, 7]. In the second step, voxels in the octants that intersect the surface models are tested. The common way is to originate a ray from the voxel and count the number of times the ray intersects the surface model. If the number is odd, it means the voxel is inside the object, and otherwise it is outside the object. The complexity of this step is in proportion to the number of faces of the surface model. To reduce complexity, Jiang [8] built BSP trees to subdivide the model so that fewer faces are taken into account. But the efficiency is still limited when for large-scale geological bodies need to be modeled. The filling method is based on the fact that the interior and exterior of an object are different connected components separated by the boundary, which requires no intersection tests. First, the boundary of the object needs to be converted into voxels, and then octants are filled into the voxelized boundary. Tamminen [9] designed a partial 3D binary tree structure to represent the border of the object, and the filling procedure was done by traversing the tree to determine whether the nodes being processed are in the interior of the object. For linear octrees, the nodes to be filled should be determined based on neighbors finding technique [10]. Atkinson et al. [11], Yang and Lin [12] proposed algorithms for constructing linear octrees from closed voxelized boundaries. However, the filling method is also time-consuming when the object is large. Although by using hardware rasterization the boundary of objects can be voxelized very fast [1, 2], some errors such as losing target voxels still cannot be avoided. It cannot guarantee to gain a closed voxelized boundary and make the results unpredictable.

January (2010) Vol.53 No.1

In comparison, the divide-and-conquer method is robust. Its computational bottleneck is face-to-face intersection and the voxel enclosure test procedure. As the development of graphics hardware, these procedures can be accomplished fast by GPU acceleration. Considering the GPU acceleration efficiency, we carried out the study using divide-and-conquer strategy, and the linear octree generation is done in a brute-force procedure, similar to the bottom-up approach that converts 3D binary arrays to linear octrees. Gargantini [3] provided a general construction method (Figure 1). Firstly, voxels in the universe, which is a cubical region enclosing objects of interest, are scanned and each black voxel’s coordinate is encoded and recorded. In this way, an unsorted list storing the locational keys for these voxels can be obtained. Then the sorting is required for these locational keys. After the sorting procedure, the compression is performed in which those eight adjacent locational keys sharing with a common parent octant are grouped into their parent octant’s locational keys. Such a sorted and compressed list of locational keys is called a linear octree. We take each element in the list as a linear octree encoding. To improve the efficiency of linear octree construction, Mark and Abel [13] proposed a method that employs decimal code to encode locational key, which enables the conversion between spatial coordinates of octants and their locational keys to be fast by bitwise operations. Dunstan and Mill [14] developed an algorithm that traverses the sorted list only once for compression. Cao and Liu [15] used the counting sort to increase the sort speed. This sorting, however, requires allocating additional storage space. Zhou et al. [16, 17] extended optimal construction algorithm for linear quadtree [18] to linear octree construction, and a mid storage structure called digital search tree was introduced for sorting. The algorithm has high efficiency, for the compressing process is avoided. But all these algorithms have to perform sorting, which is timeconsuming. They do not support outputting linear octree

Figure 1

Conventional construction method of linear octree.

DENG Hao, et al.

Sci China Earth Sci

January (2010) Vol.53 No.1

115

encoding dynamically for interactions in networking environment as well. One advantage of outputting encoding dynamically is that the process in the other side on networks can perform such operations as set operations [4] with received encoding in parallel.

2 Methodology The proposed algorithm is also divided into two stages. The first stage is the subdivision procedure in which the object being modeled is subdivided into octants. For each octant, this procedure determines its relationship to the object, namely, to determine the octant that is entirely inside (black), partly inside (gray) or entirely outside of the object (white). Only in non-white octants can black leaves be generated, so it is unnecessary to take white octants into account. Generation of linear octree encoding is performed in the second stage. During this stage, our algorithm processes each non-white octant, and generates the linear octree encoding corresponding to the octant. When all non-white octants have been processed, the linear octree generation for the whole object is accomplished. In the next section, we will present a hardware acceleration approach based on Z-buffers for determining the relationship between octants and objects and for determining the attributes of voxels. 2.1

Application of the Z-buffers

The Z-buffer algorithm [19] can obtain depth images where each pixel records minimum or maximum depth values. Nowadays this algorithm is hardware implemented in GPU, even an ordinary GPU can generate depth buffers of objects very fast. Depth buffers were exploited for voxelization by Karabassi et al. [20]. Our algorithm uses the same method to determine whether a voxel belongs to the object, and extends the method to determine the attributes of octants. By specifying viewpoints and values used for the depth buffer comparison, three pairs of depth buffers with the size of 2n×2n that are respectively perpendicular to the X, Y and Z axis can be set up. Mark them [X1, X2], [Y1, Y2], [Z1, Z2] respectively, where the first one of each pair stores the nearest depth values to the viewer, whereas the second one stores the farthest depth values. Let these six depth buffers build a cubical bounding box equivalent to the 2n×2n×2n universe to enclose the object (Figure 2). Suppose that there is a voxel (I, J, K) whose position is (x, y, z) in the universe, for the conditions: X1(K, J)≤x≤X2 (K, J), Y1 (I, K)≤y≤Y2 (I, K) and Z1 (I, J)≤z≤Z2 (I, J), Only if all of them can be met, then the voxel lies inside the object and then is black; Otherwise it lies outside otherwise and then is white. For an octant whose subdivision level is l (l

Suggest Documents