This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Variational Hierarchical Directed Bounding Box Construction for Solid Mesh Models

Rui Wang       Wei Hua       Gaofeng Xu       Yuchi Huo       Hujun Bao
Abstract

Object oriented bounding box tree (OBB-Tree for short) has many applications in collision detection, real-time rendering, etc. It has a wide range of applications. The construction of the hierarchical directed bounding box of the solid mesh model is studied, and a new optimization solution method is proposed. But this part of the external space volume that does not belong to the solid mesh model is used as the error, and an error calculation method based on hardware acceleration is given. Secondly, the hierarchical bounding box construction problem is transformed into a variational approximation problem, and the optimal hierarchical directed bounding box is obtained by solving the global error minimum. In the optimization calculation, we propose that combining Lloyd clustering iteration in the same layer and MultiGrid-like reciprocating iteration between layers. Compared with previous results, this method can generate aired original solid mesh models are more tightly packed with hierarchical directed bounding box approximation. In the practical application of collision detection, the results constructed using this method can reduce the computational time of collision detection and improve detection efficiency.

1 Introduction

Hierarchical bounding volumes are used to approximate complex geometric objects with several bounding volumes with slightly larger volumes and simple shapes. In many occasions that require real-time computing (such as collision detection, real-time rendering, etc.) To replace the original geometric object to participate in the calculation, to achieve the purpose of simplifying the calculation. Taking collision detection as an example, in the process of traversing the bounding volume hierarchy tree, the basic geometry that is obviously impossible to intersect can be excluded early through the fast intersection test between bounding volumes. object, thereby effectively improving the speed of collision detection.

Due to the wide range of applications, people have carried out a lot of research on the construction of hierarchical bounding volumes. According to different application requirements, geometric bounding volumes of different basic shapes can be selected to construct the hierarchical optimization approximation of the scene. These geometric bounding volumes include: Sphere [5, 32] (sphere), Axial Bounding Box (AABB) [4], Oriented Bounding Box (OBB) [12] and Oriented Polyhedrons (k-DOPs) [21] and so on.

When people choose the basic shape of the bounding volume, they often need to balance the tightness of the original geometric object with the simplicity of the bounding volume test. Bounding volumes with complex shapes, such as directed polyhedra (k-DOPs), can be achieved via tighter wrapping. However, more complex intersection calculation is required during testing; for simple bounding volumes, although the calculation is simple during testing, the wrapping effect of the original geometric object is poor, which reduces the test efficiency to a certain extent. Weghorst et al. [33] proposed an expression for evaluating the quality of hierarchical bounding volumes for accelerated ray tracing algorithms, and it is widely used in situations where hierarchical bounding volumes are used, including collision detection [12]. To measure a static evaluation function for the effectiveness of the hierarchical bounding volume, which is defined as

e=nvcv+npcpe=n_{v}\cdot c_{v}+n_{p}\cdot c_{p} (1)

where nvn_{v} is the number of bounding volume intersection calculations, cvc_{v} is the cost of performing a bounding volume intersection calculation, npn_{p} is the number of patch intersection calculations, and cpc_{p} is the cost of the intersection calculations.

For different applications, a variety of hierarchical bounding volumes with different basic shapes have been proposed. In the application of collision detection, the hierarchical directed bounding box proposed by Gottschalk [12] is one of the most commonly used hierarchical bounding volumes. Therefore, this paper Select the directed bounding box to construct the hierarchical bounding volume, and study the construction algorithm of the optimal hierarchical directed bounding box. For the bounding box, cvc_{v} and cpc_{p} in formula can be regarded as constants, so the cost of the evaluation function e is minimized That is to find a hierarchical bounding box with as small nvn_{v}, npn_{p} as possible.

For the number of times npn_{p} of patch intersections, if the hierarchical directed bounding box is closer to the original model in appearance and shape, then the probability of misjudgment in the hierarchical directed bounding box test is smaller, and finally it involves the fine intersection of the original model. The number of patches that can be accurately determined is also less. Based on this, we propose to use the outer volume as an error measure to measure the approximation degree between the hierarchical directed bounding box and the original model. The outer volume refers to the space that belongs to the bounding volume but does not belong to the original grid The spatial volume of the model. This error definition does not consider the overlap of the bounding box inside the object, and only considers the part of the bounding box outside the original model, which allows us to minimize the error to obtain the optimal approximation of the original mesh model, Hierarchical directed bounding Box. This paper gives the definition and calculation method of the outer volume and transforms the construction of the hierarchical directed bounding box into a variational approximation problem.

To reduce the number of intersections nvn_{v} of bounding boxes, it is necessary to wrap the upper bounding box more tightly. This is because the tighter wrapping of the upper bounding box can be more Quickly remove those lower bounding boxes that do not need to participate in testing. Traditionally, people generally use top-down or bottom-up division or greedy merging method to construct a hierarchical directed bounding box, due to the lack of effective metrics in the construction to control the level of the bounding box and its tightness to the original model approximation. Therefore, it is difficult to ensure that the final hierarchical directed bounding box is optimal. Based on the external volume metric proposed in this paper, we adopt a method similar to MultiGrid [6] The multi-layer reciprocating iterative optimization of the bounding box between layers and the Lloyd [24] clustering iterative optimization method of the same layer of the bounding box, to achieve the smallest error in the global sense. By optimizing the solution, the hierarchical directed bounding box that wraps the original solid mesh model most closely can be obtained.

The novelty of this paper is that: firstly, by defining the error metric of the outer volume, the problem of constructing a hierarchical directed bounding box is formalized as a minimization The optimization approximation problem of the outer volume; secondly, in the optimization solution, a tighter directional bounding box is obtained through the optimization iteration between multiple layers and the clustering iteration between the same layers.

2 Related Work

Hierarchical bounding box is used for accelerating rendering-based applications [29, 28, 17, 16, 15, 7, 10, 19, 18, 14, 20, 23, 1, 27, 36, 22]. The initial method of constructing a hierarchical bounding volume is to perform octree division of a mesh model in space [13]. When the division reaches a certain depth, it stops, and each non-empty leaf node containing a patch forms a bounding volume to form a bounding volume. Obtain the approximation of the original model. Obviously, the approximation effect of this bounding volume uniformly divided in the world coordinate system space is very poor. Subsequently, people proposed a method of constructing a hierarchical bounding volume with an object as the approximation object, which is referred to as a hierarchical bounding volume for short. Bounding volume hierarchies algorithm. Due to the relative simplicity of spherical parameters, there are many algorithms that use spheres to construct scene-level bounding volumes [5, 32], but it is often difficult to obtain tight wrapping results. Based on the axial bounding box (AABB), the hierarchical bounding volume algorithm [4, 3] is very fast, but the approximation effect of the original model is not very good. The directed bounding box (OBB) can approximate the object more closely than the axial bounding box and the bounding sphere, and it is significantly However, the intersection detection between directed bounding boxes is more time-consuming than the intersection detection between axial bounding boxes or bounding spheres. Directed polyhedrons (k-DOPs) [21] can be regarded as having Further generalization to the bounding box, although it can enclose the original object more tightly than other bounding volumes, the intersection detection between directed polyhedra is obviously more complicated.

This paper mainly discusses the construction methods of directed hierarchical bounding boxes. In the construction of hierarchical directed bounding boxes, most of the existing methods use top-down subdivision or bottom-up merging strategies to build hierarchical structures. Top-down methods based on subdivision strategies do not consider whether the original model is actually approximated, but use such as the longest axis of the enclosed model [13] or the principal component analysis of the spatial position of the enclosed model. The bottom-up merging strategy can only optimize and analyze the local approximation situation when merging. Therefore, this kind of algorithm basically adopts the greedy algorithm, and the obtained approximation. The results are mostly local optima.

Cohen-Steiner et al. [8] proposed a variational patch approximation method for mesh approximation research, which transformed the solution of patch approximation into finding a variational energy optimum, and achieved good results. Wu et al. [34] inherited the Cohen-Steiner method and proposed a variational approximation method for approximating the mesh model with a high-order polynomial patch [32], and Lu et al. [25] further extended it to the application of bounding ellipsoids. The method in this paper adopts the hierarchical optimization approximation based on the directed bounding box. The directed bounding box has more advantages than bounding spheres or ellipsoids. For more complex shapes, the analytic form in the literature [32] cannot be used for the calculation of the directed bounding box, so new methods need to be studied. In addition, the above methods for generating bounding volumes do not consider the construction of the hierarchical relationship between bounding volumes. This paper It is the first time to introduce variational methods into the construction of hierarchical bounding volumes.

3 Hierarchical Directed Bounding Box Approximation

In this paper, we use XX to denote a 3D mesh model, and YY to denote a hierarchical directed bounding box. For a directed bounding box with a hierarchical structure, we use OijO_{ij} to denote the jj-th directed bounding box of the ii-th layer in YY, use Zi=Oi0,Oi1,,OinZ_{i}={O_{i0},O_{i1},…,O_{in}} to represent the set of directed bounding boxes of the ii-th layer in YY. In the case of only discussing the same layer, for convenience, we omit the subscript ii and use Z=OjZ={O_{j}} represents the directed bounding box of the same layer. Since this paper studies the solid grid model, we use Ω()\Omega(\cdot) to represent the volume of space occupied by the 3D object. Then a layer of the 3D grid model XX is directed The bounding box YY can be defined as

Definition 1. YY is called a hierarchical directed bounding box approximation of the triangular mesh model XX, when YY satisfies

xΩ(X),xΩ(Y),\forall x\in\Omega(X),x\in\Omega(Y), (2)

where xx is a three-dimensional point in space, and Y=iZi=i,jOijY=\bigcup_{i}Z_{i}=\bigcup_{i,j}O_{ij} is the union of a series of hierarchical directed bounding boxes.

In order to calculate the optimal hierarchical directed bounding box approximation, we define the part of the volume in the space that belongs to the hierarchical directed bounding box YY but does not belong to the model XX as the error, and calls such a spatial volume the outside mesh volume, Represented by OMV(X,Y)OMV(X,Y),

OMV(X,Y)=R3g(x,X,Y)𝑑x\displaystyle OMV(X,Y)=\int_{R^{3}}g(x,X,Y)dx (3)
g(x,X,Y)=1,ifxΩ(X)andxΩ(Y)\displaystyle g(x,X,Y)=1,\quad if\quad x\notin\Omega(X)\quad and\quad x\in\Omega(Y)
g(x,X,Y)=0,others\displaystyle g(x,X,Y)=0,\quad others

It is difficult to solve such an external volume accurately, quickly and efficiently for complex mesh models. We first introduce a single directed bounding box OO. For the outer volume of the mesh model XX, the outer volume of the directed bounding box belonging to the same layer in the hierarchy is further given, and finally the calculation layer is given. A method for calculating the outer volume of a sub-directed bounding box.

For the outside bounding object volume of a single directed bounding box OO, we denote it by OBV(X,O)OBV(X,O), which is similar to the calculation like formula (3):

OMV(X,Y)=R3g(x,X,O)𝑑x\displaystyle OMV(X,Y)=\int_{R^{3}}g(x,X,O)dx (4)
g(x,X,Y)=1,ifxΩ(X)andxΩ(O)\displaystyle g(x,X,Y)=1,\quad if\quad x\notin\Omega(X)\quad and\quad x\in\Omega(O)
g(x,X,Y)=0,others\displaystyle g(x,X,Y)=0,\quad others

According to formula (4), the external volume of multiple directed bounding boxes Z=O0,O1,,OnZ={O_{0},O_{1},…,O_{n}} belonging to the same layer to the original model X can be expressed as

OMV(X,Z)=OMV(x,jOj)\displaystyle OMV(X,Z)=OMV(x,\bigcup_{j}O_{j}) (5)
=jOBV(X,Oj)Overlap(OBV(X,jOj)),\displaystyle=\sum_{j}OBV(X,O_{j})-Overlap(OBV(X,\bigcup_{j}O_{j})),

where Overlap(OBV(X,jOj))Overlap(OBV(X,\bigcup_{j}O_{j})) is the overlapping part of the bounding box outside the original model XX. Note that the volume of the overlapping part exist. That is, Overlap(OBV(X,jOj))0Overlap(OBV(X,\bigcup_{j}O_{j}))\geq 0, so jOBV(X,Oj)OMV(X,Z)\sum_{j}OBV(X,O_{j})\geq OMV(X,Z). Accordingly, jOBV(X,Oj)\sum_{j}OBV(X,O_{j}) can be used as the exact outer volume OMV(X,Z)OMV(X,Z)’s upper bound estimation. In optimization, reducing jOBV(X,Oj)\sum_{j}OBV(X,O_{j}) can also reduce the exact outer volume of XX and ZZ. The computation of jOBV(X,Oj)\sum_{j}OBV(X,O_{j}) is much easier than directly computing the exact outer volume. In practical calculations, we use the sum of the outer volumes of the bounding box in ZZ and the exact outer volume in place of ZZ to speed up the computation.

OMV(X,jOj)jOBV(X,Oj).OMV(X,\bigcup_{j}O_{j})\approx\sum_{j}OBV(X,O_{j}). (6)

For the total outer volume of the hierarchical directed bounding box, the upper bounding box that is tightly packed can effectively reduce the calculation amount of the intersection test of those lower bounding boxes that do not need to be calculated. Therefore, the upper bounding box approximates the original model to a higher degree than the lower bounding box. The degree of approximation of the original model is more important. We define the total outer volume of the hierarchical directed bounding box by introducing weights related to the hierarchy:

e=i=1nvωi(i)OMV(X,Zi),e=\sum_{i=1}^{n_{v}}\omega_{i}(i)\cdot OMV(X,Z_{i}), (7)

where ωi(i)\omega_{i}(i) is the weight function related to the layer where ZiZ_{i} is located, and the bounding box of the upper layer has a larger weight.

To sum up, by introducing the external volume, we formulate the hierarchical directed bounding box construction problem of the triangular mesh model as the following variational optimization problem,

mine=i,jωj(i)OBV(X,Oij)=i,jωi(i)R3g(x,X,Oij)𝑑x.\min e=\sum_{i,j}\omega_{j}(i)\cdot OBV(X,O_{ij})=\sum_{i,j}\omega_{i}(i)\cdot\int_{R^{3}}g(x,X,O_{ij})dx. (8)

That is to find an optimal bounding box to approximate YY, so that the overall error of is minimized.

4 Optimal Solution of Hierarchical Directed Bounding Box

4.1 Exterior Volume Calculation of Single Bounding Box

Refer to caption
Figure 1: The computation of signed outside bounding object volume.

Due to the complexity of the grid model, we consider a discrete method to calculate formula (4). First, consider the case where the center of the bounding box is inside the original grid model XX, as shown in Figure 1(a), we send out from the center of the bounding box to the direction ω\omega an intersection ray ll. The inteersction points with the mesh model XX are recorded as p0,p1,,pnp_{0},p_{1},...,p_{n}, respectively, and finally intersect with the boundary of the bounding box at the point pep_{e}. Then the part loutl_{o}ut of the line segment opeop_{e} outside the mesh model XX can be calculated by the following:

lout=peoisign(n(pi)ω)piol_{out}=p_{e}o-\sum_{i}sign(n(p_{i})\cdot\omega)p_{i}o (9)

where signsign is the sign function, and the contribution of each line segment to the external volume can be judged according to the relative direction of the normal at point pip_{i} and the ray ll. For example, in Figure 1(a) the length of the line segment outside the grid (indicated by the dotted line) is lout=peo(p2op1o+p0o)l_{out}=p_{e}o-(p_{2}o-p_{1}o+p_{0}o).

The total outer volume can be obtained by integrating ω\omega in all directions in local coordinates centered on the bounding box:

OBV(X,O)=Ωlout(ω)𝑑ω.OBV(X,O)=\int_{\Omega}l_{out}(\omega)d\omega. (10)

When the center of the bounding box is outside the mesh model, we use the same method as above to calculate the volume inside the mesh model (dashed line segment in Figure 1(b)). Finally, subtract the inner volume from the total volume of the bounding box to get the outer volume.

In practice, we use GPU to accelerate the calculation: take the center of the bounding box as the viewpoint, map the spatial direction to the CubeMap of 6×m×m6\texttimes m\texttimes m (for example, m=32m=32), one pixel on each surface of the CubeMap corresponds to A direction cone; using each face of the CubeMap as the projection plane, by drawing the bounding box OO and the grid model XX, the volume of the direction cone inside and outside the grid is calculated in the shader; finally, by adding and subtracting the volume of these tetrahedrons Obtain the external volume. We adopt a 4-step calculation process: 1) Draw the triangular mesh TOT_{O} of the bounding box, calculate the depth of the intersection pep_{e} of each pixel direction l(ω)l(\omega) and TOT_{O}, and calculate the direction cone corresponding to peop_{e}o according to the depth 2) Draw the triangular mesh TXT_{X} of the original model, and send the depth texture of the bounding box in each discrete direction obtained in the first step into the drawing pipeline. Use the vertex shader and fragment shader to calculate the intersection of the light and TXT_{X} The depth of pip_{i} and the normal direction at the intersection point, and compare the depth of pip_{i} with the depth of the intersection pep_{e} of the bounding box passed in in this direction in the fragment shader. If the depth of pip_{i} is less than the depth of pep_{e}, calculate the corresponding depth in this direction. The volume of the direction cone. If the depth of pip_{i} is greater than the depth of pep_{e}, it means that the intersection point is outside the bounding box and does not participate in the calculation. Using the Blend operation of Opengl, the volume of the direction cone calculated by all intersection points is summed and output as Texture. 3) The third step, align the textures of the first and second steps and draw, and use the fragment shader to do subtraction to get the final external volume in each direction, which is output as color. 4) It will represent the external volume in each direction The color results are read back from the graphics card and summed to get the total external volume.

4.2 Optimal Solution of Hierarchical Directed Bounding Box Approximation

4.2.1 Optimal Solution of Bounding Box Approximation in Hierarchy

Refer to caption
Figure 2: Algorithm of OBBs approximation.

Due to the complexity of the 3D grid model, the algorithm that directly solves a set of directed bounding boxes in 3D space to optimize the approximation to the grid model has high complexity and is difficult to calculate. Cohen-Steiner [8] proposed new approximation approach, which transforms the patch approximation problem into a global optimization of patch partitioning. Based on their work, we propose a variational directed bounding box for mesh models Approximation algorithm.

For all patches FF of the triangular mesh model XX, find a division of FF, F0,F1,,FN{F_{0},F_{1},…,F_{N}}, satisfying F=iFiF=\bigcup_{i}F_{i} and FiFj=F_{i}\bigcap F_{j}=\emptyset, iji\neq j, such that the outer volume iOBV(X,Oi)\sum_{i}OBV(X,O_{i}) is minimized when the bounding box OiO_{i} surrounds FiF_{i}. That is

argminF0,F1,,Fne(X,Z)=jOBV(X,Oj)\displaystyle\arg\min_{F_{0},F_{1},...,F_{n}}e(X,Z)=\sum_{j}OBV(X,O_{j}) (11)
s.t.F=iFi;FiFj=,ij;FiOi\displaystyle s.t.\quad F=\bigcup_{i}F_{i};F_{i}\cap F_{j}=\emptyset,i\neq j;F_{i}\in O_{i}

For the partitioning this formular, we use the iterative Lloyd [24] clustering algorithm to solve the problem. The flow of the algorithm is shown in Figure 2. Since the underlying constraint of the directed bounding box is the need to conservatively enclose the original model, when After the spatial position and the directed axis of the directed bounding box are determined, the shape parameters of the bounding box are also uniquely determined for the determined patch division. Therefore, in the calculation, we only need to optimize the position of the directed bounding box and the directed bounding box with 6 parameters to the axis.

Refer to caption
Figure 3: One iteration step in OBBs approximation.

According to Lloyd iteration:

Initialization. For each bounding box, we randomly select one or several patches as seeds to start partitioning. Figure 3(b) shows the initial seeds.

Iterative optimization. Our iteration consists of 3 steps: compute a new partition based on the current bounding box parameters (center and directed axis), update the parameters of each bounding box based on the new partition, if necessary The partition is adjusted to avoid getting trapped in local minima. Figure 3(c f) illustrates an iterative optimization process.

1) Patch division. During patch division, the center of the bounding box remains unchanged. We use a filling algorithm (Flooding): maintain a priority queue to save the distance from each patch to the nearest bounding box; at the beginning, for the center of each bounding box, we select a patch closest to it as a seed and push it into the queue; when processing, each time a patch with the smallest distance tmint_{min} to the center of the nearest bounding box is taken from the queue, and its adjacent faces The patch is put into the queue; for the patch, we divide it into different bounding boxes OiO_{i} respectively, and calculate the outer volume change dOBV(X,Oi)dOBV(X,O_{i}) of the bounding box caused by the change of the shape parameter of OiO_{i} from SiS_{i} to SiS_{i}^{\prime} after dividing it from tmint_{min} to OiO_{i}.

dOBV(X,Oi)=OBV(X,Oi(Si)OBV(X,Oi(Si)).dOBV(X,O_{i})=\|OBV(X,O_{i}(S_{i}^{\prime})-OBV(X,O_{i}(S_{i}))\|. (12)

Our partitioning principle is to partition tmin to the bounding box OkO_{k} with the smallest external volume change, that is, OkO_{k} satisfies:

i1,2,,NdOBV(X,Oi)dOBV(X,Oi).\forall i\in{1,2,...,N}dOBV(X,O_{i})\leq dOBV(X,O_{i}). (13)
Refer to caption
Figure 4: The criteria of clustering triangles.

Figure 4 shows the criterion of patch division by a point division. The division of a patch does not depend on its distance from the nearby bounding box, but according to the minimum external volume change. When point pp has two potential bounding boxes, O0O_{0} and O1O_{1}(Figure 4(a)), the outer volume caused by the division of O0O_{0} and O1O_{1} respectively (Figure 4(b), (c)) id divided to O1O_{1} with the smallest volume increase (Figure 4(d)).

In the specific implementation, we maintain a list for each bounding box to record the calculated shape parameters and the corresponding external volume. In the actual calculation, this list can greatly simplify the calculation and accelerate the partitioning process when dividing the patch, and improve the approximate efficiency of optimization calculations.

2) Bounding box parameter update. When a new patch division is obtained, for each bounding box there is a patch set FiF_{i}, we need to find the optimal directed bounding box parameters to minimize the outer volume surrounding FiF_{i}. It is difficult to solve it analytically, so we use the numerical discrete solution method. The gradient direction of the point is obtained by perturbing the method near the initial parameters, and then the steepest descent method is used to solve the optimal bounding box parameters. Although the parameters of the directed bounding box The dimension is 6, but since we use a GPU-accelerated method to quickly calculate the outer volume under a certain parameter, updating the bounding box parameters using a discrete method can be done quickly.

3) Adjustment of bounding box. Due to the problem of initial value selection, the above iterative process sometimes gets stuck in a local minimum and cannot continue. When the total outer volume changes very little in several iterations, we sort the number of bounding patches, the size of the overlapping area between bounding boxes, etc., according to the importance of bounding boxes, and a new directed bounding box approximation is obtained by adjusting the least important bounding box. If the error is smaller than before the adjustment, then we continue the optimization iteration from the adjusted result, otherwise the adjustment is rejected and the optimization is exited. After adjusting the bounding box, our method can better bypass the local minimum in the optimization and obtain better results.

Refer to caption
Figure 5: Optimization of hierarchical OBBs.

4.2.2 Optimal Solution of Bounding Box Approximation between Levels

Based on the calculation method of the directed bounding box at the same layer, and drawing on the idea of the MultiGrid [6] method for solving multivariable differential problems, we propose an iterative solution algorithm for multi-resolution reciprocating optimization for the approximation of hierarchical bounding boxes.

The algorithm flow is shown in Figure 5(a), and Figure 5(b) illustrates the optimization of the algorithm between different layers in the solution iteration. The dot is an iteration, and the direction of the short arrow indicates that the top-down optimization strategy is adopted. The dotted arrows indicate that the bottom-up optimization strategy is adopted. Through repeated optimization iterations between different levels, under the premise of ensuring the computational efficiency, the optimization solves the hierarchical bounding box approximation with the smallest error (formula (7)).

Top-down decomposition optimization strategy: the number of bifurcations of the hierarchical directed bounding box is given in advance. For a directed bounding box OiO_{i} given a patch partition, we use the method in the previous subsection to solve its lower bounding box. One-level bounding box approximation. Top-down decomposition optimization recursively solves to a predetermined depth and then switches to bottom-up merge optimization.

Bottom-up merging optimization strategy: The object of merging optimization is the bounding box of the lower layer corresponding to a certain level node. During merging optimization, starting from the bounding box of the current level as the bounding box of the leaf node, the same layer as the previous section is adopted layer by layer. The method of solving the bounding box approximation is similar to the combined optimization calculation, but in the calculation, the patch is no longer used as the division unit, but the bounding box is used as the division unit. By calculating the optimal division of these bounding boxes, after each merging, we calculate the error of the merged hierarchy according to formula (7). If the result is not as good as before merging, then abandon the merging optimization and switch to the top-down decomposition optimization. Good before merging, then continue to merge and optimize the upper nodes.

Compared with the traditional optimization solution of hierarchical bounding boxes, three methods are generally used: bottom-up and step-by-step insertion of hierarchical nodes. Compared with the top-down method [21, 3, 11, 26], the traditional methods are basically based on greed ( greedy) strategy, which only considers the current layer for optimization, and cannot guarantee the optimization of the overall error; our method can achieve the minimum overall error by defining the overall error and reciprocating iterative optimization between layers. However, since our method requires different layers Compared with the traditional method, it requires more computation time.

5 Result and Comparison

Refer to caption
Figure 6: Results comparison of ours and OBB-Tree’s.

In the experiment, we choose to build a binary hierarchical directed bounding box. In the calculation, we take ωi=lsub\omega_{i}=l_{sub} as the weight between the layers, where lsubl_{sub} is the number of layers from the layer to the leaf node, for example, the leaf node’s ωi=1.0\omega_{i}=1.0; ωi=2.0\omega_{i}=2.0 of the node at the top of the leaf node, and so on. In the experiments later in this chapter, the above simple approach achieves good results.

Although we have adopted some acceleration methods, this method requires more computation time than the traditional directed hierarchical bounding box construction method. In our experiments, for 8k 10k models, the GPU takes 20 80 milliseconds to perform an outer volume calculation, but due to the large amount of external volume calculation required for patch division and bounding box parameter update, it takes 2  3 hours to construct a 12-layer binary directed hierarchical bounding box (the number of leaf nodes is 2122^{12}).

Since OBB-tree [12] is the most widely used directed hierarchical bounding box algorithm, and the author provides the source code RAPID (http://www.cs.unc.edu/ geom/OBB/OBBT.html), so our comparison is conducted around it. Comparisons are made from the appearance and geometric errors of the generated hierarchical bounding boxes and the computational efficiency in collision detection applications.

Figure 6 shows the approximation results of multiple models using our method OBB-Tree method, showing the approximation results of the directed bounding box of the three models ”Snakie”, ”Armadillo” and ”Dinosaur” at different levels. We only show the results of bounding boxes for layers 1-8. From the results, our method is better in terms of the error comparison between the visual results and the outer volume.

Refer to caption
Figure 7: Performance comparison in collision detection between ours and OBB-Tree’s.

In order to detect the practical application of the approximation results in collision detection, we build a collision detection test environment (Figure 7) based on the open source physics engine library ODE (http://www.ode.org/). In this environment, the model revolves around Its own center rotates, and a collider falls from the top. We test the intersection between the collider and the model. If the model collides with the collider, the collider will be bounced. In the collision detection, we use our method to generate the The hierarchical bounding box and the hierarchical bounding box generated by the OBB-tree [12] method are used for rough calculation of intersection. Taking one collider-bounding box intersection as an intersection calculation unit, record the rough calculation of the hierarchical bounding box in unit time. The total number of collider-bounding box intersections required for the intersection. From the perspective of real-time performance, the smaller the number of intersections, the better the approximation effect of the hierarchical bounding box. In the comparison, we test a longer time, choose a large number (¿ 1000) colliders drop randomly. The results of the number of intersections/time are shown in Figure 7. As can be seen from the figure, under a large number of intersection tests, our hierarchical bounding box is better than the results generated by the OBB-tree [12] method. Even better, for the 3 models we tested, the number of intersections can be reduced by 10%17%10\%~17\%.

6 Conclusion

This paper mainly discusses the hierarchical structure construction of the directed bounding box approximation of the solid mesh model. It is proposed to use the outer volume as a measure to measure the tightness of the bounding box approximation to the mesh model, thereby transforming the construction of the hierarchical bounding box into a variational approximation problem. In the optimization calculation of the optimal hierarchical bounding box approximation, we use the multi-layer reciprocating iteration similar to MultiGrid [6] and the Lloyd [24] clustering iterative method to solve the variational optimization with the smallest error in the global sense to obtain the optimal solution. The original solid mesh model is the most tightly packed hierarchical directed bounding box. Compared with the previous results, our method is better.

The biggest drawback of this method is that the calculation time is long. Compared with the traditional method, it is more suitable for occasions where the quality of the approximation results is higher, but the preprocessing time is less restricted. Although some acceleration methods have been considered in this paper, improving computational efficiency is still one of the focuses of the next research. In addition, this method uses the external volume as the error metric, so it can only deal with solid mesh models with spatial volumes, but in practical applications, a large number of meshes are not closed models, therefore, our next step will be to target the hierarchical directed bounding box construction method for a more general grid model and carry out the next step.

There are some extended articles about applying physical lighting computation in various applications:

  1. 1.

    Deep Learning-Based Monte Carlo Noise Reduction By training a neural network denoiser through offline learning, it can filter noisy Monte Carlo rendering results into high-quality smooth output, greatly improving physics-based Availability of rendering techniques [19], common research includes predicting a filtering kernel based on g-buffer [2], using GAN to generate more realistic filtering results [35], and analyzing path space features Perform manifold contrastive learning to enhance the rendering effect of reflections [7], use weight sharing to quickly predict the rendering kernel to speed up reconstruction [10], filter and reconstruct high-dimensional incident radiation fields for unbiased reconstruction rendering guide [18], etc.

  2. 2.

    The multi-light rendering framework is an important rendering framework outside the path tracing algorithm. Its basic idea is to simplify the simulation of the complete light path illumination transmission after multiple refraction and reflection to calculate the direct illumination from many virtual light sources, and provide a unified Mathematical framework to speed up this operation [9], including how to efficiently process virtual point lights and geometric data in external memory [29], how to efficiently integrate virtual point lights using sparse matrices and compressed sensing [17], and how to handle virtual line light data in translucent media [16], use spherical Gaussian virtual point lights to approximate indirect reflections on glossy surfaces [15], and more.

  3. 3.

    Automatic optimization of rendering pipelines Apply high-quality rendering technology to real-time rendering applications by optimizing rendering pipelines. The research contents include automatic optimization based on quality and speed [30], automatic optimization for energy saving [31, 36], LOD optimization for terrain data [23], automatic optimization and fitting of pipeline rendering signals [22], anti-aliasing [zhong2022morphological], etc.

  4. 4.

    Using physically-based process to guide the generation of data for single image reflection removal [20]; propagating local image features in a hypergraph for image retreival [1]; managing 3D assets in a block chain-based distributed system [27].

References

  • [1] G. An, Y. Huo, and S.-E. Yoon. Hypergraph propagation and community selection for objects retrieval. Advances in Neural Information Processing Systems, 34, 2021.
  • [2] S. Bako, T. Vogels, B. McWilliams, M. Meyer, J. Novák, A. Harvill, P. Sen, T. Derose, and F. Rousselle. Kernel-predicting convolutional networks for denoising monte carlo renderings. ACM Trans. Graph., 36(4):97–1, 2017.
  • [3] G. Barequet, B. Chazelle, L. J. Guibas, J. S. Mitchell, and A. Tal. Boxtree: A hierarchical representation for surfaces in 3d. In Computer Graphics Forum, volume 15, pages 387–396. Wiley Online Library, 1996.
  • [4] G. v. d. Bergen. Efficient collision detection of complex deformable models using aabb trees. Journal of graphics tools, 2(4):1–13, 1997.
  • [5] G. Bradshaw and C. O’Sullivan. Adaptive medial-axis approximation for sphere-tree construction. ACM Transactions on Graphics (TOG), 23(1):1–26, 2004.
  • [6] W. L. Briggs, V. E. Henson, and S. F. McCormick. A multigrid tutorial. SIAM, 2000.
  • [7] I.-Y. Cho, Y. Huo, and S.-E. Yoon. Weakly-supervised contrastive learning in path manifold for monte carlo image reconstruction. ACM Transactions on Graphics (TOG), 40(4):38–1, 2021.
  • [8] D. Cohen-Steiner, P. Alliez, and M. Desbrun. Variational shape approximation. In ACM SIGGRAPH 2004 Papers, pages 905–914. 2004.
  • [9] C. Dachsbacher, J. Křivánek, M. Hašan, A. Arbree, B. Walter, and J. Novák. Scalable realistic rendering with many-light methods. In Computer Graphics Forum, volume 33, pages 88–104. Wiley Online Library, 2014.
  • [10] H. Fan, R. Wang, Y. Huo, and H. Bao. Real-time monte carlo denoising with weight sharing kernel prediction network. In Computer Graphics Forum, volume 40, pages 15–27. Wiley Online Library, 2021.
  • [11] J. Goldsmith and J. Salmon. Automatic creation of object hierarchies for ray tracing. IEEE Computer Graphics and Applications, 7(5):14–20, 1987.
  • [12] S. Gottschalk, M. C. Lin, and D. Manocha. Obbtree: A hierarchical structure for rapid interference detection. In Proceedings of the 23rd annual conference on Computer graphics and interactive techniques, pages 171–180, 1996.
  • [13] P. M. Hubbard. Collision detection for interactive graphics applications. IEEE Transactions on Visualization and Computer Graphics, 1(3):218–230, 1995.
  • [14] Y. Huo. Extension–adaptive sampling with implicit radiance field. arXiv preprint arXiv:2202.00855, 2022.
  • [15] Y. Huo, S. Jin, T. Liu, W. Hua, R. Wang, and H. Bao. Spherical gaussian-based lightcuts for glossy interreflections. In Computer Graphics Forum, volume 39, pages 192–203. Wiley Online Library, 2020.
  • [16] Y. Huo, R. Wang, T. Hu, W. Hua, and H. Bao. Adaptive matrix column sampling and completion for rendering participating media. ACM Transactions on Graphics (TOG), 35(6):1–11, 2016.
  • [17] Y. Huo, R. Wang, S. Jin, X. Liu, and H. Bao. A matrix sampling-and-recovery approach for many-lights rendering. ACM Transactions on Graphics (TOG), 34(6):1–12, 2015.
  • [18] Y. Huo, R. Wang, R. Zheng, H. Xu, H. Bao, and S.-E. Yoon. Adaptive incident radiance field sampling and reconstruction using deep reinforcement learning. ACM Transactions on Graphics (TOG), 39(1):1–17, 2020.
  • [19] Y. Huo and S.-e. Yoon. A survey on deep learning-based monte carlo denoising. Computational Visual Media, 7(2):169–185, 2021.
  • [20] S. Kim, Y. Huo, and S.-E. Yoon. Single image reflection removal with physically-based training images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5164–5173, 2020.
  • [21] J. T. Klosowski, M. Held, J. S. Mitchell, H. Sowizral, and K. Zikan. Efficient collision detection using bounding volume hierarchies of k-dops. IEEE transactions on Visualization and Computer Graphics, 4(1):21–36, 1998.
  • [22] S. Li, R. Wang, Y. Huo, W. Zheng, W. Hua, and H. Bao. Automatic band-limited approximation of shaders using mean-variance statistics in clamped domain. In Computer Graphics Forum, volume 39, pages 181–192. Wiley Online Library, 2020.
  • [23] S. Li, C. Zheng, R. Wang, Y. Huo, W. Zheng, H. Lin, and H. Bao. Multi-resolution terrain rendering using summed-area tables. Computers & Graphics, 95:130–140, 2021.
  • [24] S. Lloyd. Least squares quantization in pcm. IEEE transactions on information theory, 28(2):129–137, 1982.
  • [25] L. Lu, Y.-K. Choi, W. Wang, and M.-S. Kim. Variational 3d shape segmentation for bounding volume computation. In Computer Graphics Forum, volume 26, pages 329–338. Wiley Online Library, 2007.
  • [26] S. M. Omohundro. Five balltree construction algorithms. International Computer Science Institute Berkeley, 1989.
  • [27] H. Park, Y. Huo, and S.-E. Yoon. Meshchain: Secure 3d model and intellectual property management powered by blockchain technology. In Computer Graphics International Conference, pages 519–534. Springer, 2021.
  • [28] R. Wang, Y. Huo, Y. Yuan, K. Zhou, W. Hua, and H. Bao. Implementation details of gpu-based out-of-core many-lights rendering.
  • [29] R. Wang, Y. Huo, Y. Yuan, K. Zhou, W. Hua, and H. Bao. Gpu-based out-of-core many-lights rendering. ACM Transactions on Graphics (TOG), 32(6):1–10, 2013.
  • [30] R. Wang, X. Yang, Y. Yuan, W. Chen, K. Bala, and H. Bao. Automatic shader simplification using surface signal approximation. ACM Transactions on Graphics (TOG), 33(6):1–11, 2014.
  • [31] R. Wang, B. Yu, J. Marco, T. Hu, D. Gutierrez, and H. Bao. Real-time rendering on a power budget. ACM Transactions on Graphics (TOG), 35(4):1–11, 2016.
  • [32] R. Wang, K. Zhou, J. Snyder, X. Liu, H. Bao, Q. Peng, and B. Guo. Variational sphere set approximation for solid objects. The Visual Computer, 22(9):612–621, 2006.
  • [33] H. Weghorst, G. Hooper, and D. P. Greenberg. Improved computational methods for ray tracing. ACM Transactions on Graphics (TOG), 3(1):52–69, 1984.
  • [34] J. Wu and L. Kobbelt. Structure recovery via hybrid variational surface approximation. In Comput. Graph. Forum, volume 24, pages 277–284, 2005.
  • [35] B. Xu, J. Zhang, R. Wang, K. Xu, Y.-L. Yang, C. Li, and R. Tang. Adversarial monte carlo denoising with conditioned auxiliary feature modulation. ACM Trans. Graph., 38(6):224–1, 2019.
  • [36] Y. Zhang, R. Wang, Y. Huo, W. Hua, and H. Bao. Powernet: Learning-based real-time power-budget rendering. IEEE Transactions on Visualization and Computer Graphics, 2021.