A Meshing Scheme for Memory Efficient Adaptive ... - CiteSeerX

0 downloads 0 Views 450KB Size Report
M. Amor, M. Bóo, M. Doggett, J. Hirche, W. Strasser. Abstract .... available within the current triangle to make the vertex insertion decision. This simple re-meshing.
A Meshing Scheme for Memory Efficient Adaptive Rendering of Subdivision Surfaces M. Amor, M. B´oo, M. Doggett, J. Hirche, W. Strasser

Abstract Adaptive subdivision of triangular meshes is the next step for surface generation algorithms like those used for displacement mapping, where a highly detailed model can be constructed from a coarse triangle mesh and a displacement map. In this case the communication requirements between the CPU and the graphics pipeline can be reduced if the displacement mapping projection is performed in an adaptive tessellation unit attached to the graphics pipeline. This paper presents an architecture for the implementation of the adaptive subdivision of triangular meshes in which the coarse triangle mesh is tessellated according to the surface complexity described by the displacement map. The mesh connectivity description we employ permits the reduction of the memory requirements while simultaneous allowing quick access to all the data required for each subdivision step. As a result, we obtain a regular architecture, characterized by an optimum data management that minimizes the data storage and avoids the waiting cycles associated with the multiple data accesses required for each subdivision step.

1 Introduction The reduction of the communications requirements between the CPU and the graphics pipeline has received a great deal of attention recently. Different attempts to improve the communication problems have been developed including: compression of the information [1, 2, 3, 4]; simplification of the image complexity [5, 6]; interactive multiresolution meshes [7, 8, 9, 10, 11, 12]; and displacement mapping [13, 14, 15, 16]. Displacement Mapping is an effective technique for encoding the high levels of detail of the surface models through the utilization of coarse triangle meshes together with displacement maps. Extending the hardware rendering pipeline to be capable of handing displacement maps as geometric primitives allows highly detailed models to be constructed without requiring a large number of triangles to be passed from the CPU to the graphics pipeline. The main problem of this extension is that to apply a displacement map to a triangle mesh involves re-triangulating the original mesh and displacing the vertices accordingly. The proposal presented in [17] is based on the tessellation of individual edges of each triangle sequentially by means of the local information of each edge. In that method the information of the neighbouring triangle is not employed, avoiding random accesses to information that would require an expensive hardware implementation. A closely related algorithm is surface subdivision [18, 19] in which a coarse mesh is processed in order to obtain, after some iterations, a finer detailed one. The evolution of each triangle is conditioned by the first order contiguous triangles although extensions to second order neighbours have also been proposed [20]. The solution presented in [21] combines surface subdivision with the application of a displacement map, in which a coarse mesh requires a regular non-adaptive subdivision procedure. Considering the neighbour information employed in the subdivision methods an obvious 1

next step for the method presented in [17] is the development of an adaptive tessellation unit in which the neighbour information is considered but with low storage requirements and simple connectivity management. In this paper we present an architecture for the adaptive subdivision of triangular meshes. Specifically, we propose the partitioning of the full mesh in sections in order to process each one in an individual way in the adaptive tessellation unit. The efficient management of the data permits the simultaneous access to all the neighbour information required for each partitioning step avoiding memory read wait cycles. This is due to the data distribution in memory and to the simple and compact mesh connectivity specification. The mesh representation strategy together with the regular hardware structure developed makes this solution interesting not only in the displacement map environment, but also in any algorithm where an adaptive tessellation is required.

2 Adaptive View Dependent Tessellation Displacement mapping uses a coarse triangle mesh that approximates the surface to be modeled with a displacement map containing the finer geometric detail. This representation of the information permits the reduction of the communications between the CPU and the graphics pipeline. But before rendering, an adaptive re-meshing step is required to generate a finer mesh. Obviously, the major challenge is to find a simple re-meshing algorithm that can be implemented in hardware. While many re-meshing algorithms exist, only those focussed on non-adaptive polynomial subdivisions [22] have been used for possible hardware implementations. This is due to the fact that for non-adaptive polynomial subdivisions the evolution of the mesh can be expressed as a matrix vector multiplication operation which implies an easy management of the information and hardware implementation. But in adaptive re-meshing case the evolution of the mesh can not be “a priori” estimated and the evolution of each triangle depends on the evolution of the neighbour triangles accordingly to displacement map information. For adaptive tessellation algorithms the tessellation decisions are based on neighbour information of each triangle. This means that each triangle needs access to the neighbouring triangle information requiring processing of each triangle to have access to the entire triangle list. Random access to memory of this nature is expensive when implemented in hardware. The strategy to avoid these memory requirements presented in [17] is focussed on the utilization of the local information available within the current triangle to make the vertex insertion decision. This simple re-meshing algorithm permits an efficient implementation of displacement mapping in hardware. However, there is still the challenge of implementing more complex and efficient re-meshing algorithms. In the following subsection a brief introduction to the more important subdivision techniques is presented.

2.1 Subdivision Techniques In Table 1 a classification of the vertex insertion subdivision algorithms is presented. In the second column the algorithms for triangular meshes [23, 24, 25], which is the objective of our work, are indicated meanwhile in the third column the quadrilateral meshes algorithms are classified [26, 27, 28]. Two types of vertex insertion schemes are employed (second and third row of the table): approximating and interpolating. Approximating schemes for arbitrary topology meshes are typically modifications of spline 2

Triangular Meshes

Quadrilateral Meshes

Loop

Catmull-Clark

Modified Butterfly

Kobbelt

Approximating Interpolating

Table 1: Vertex Insertion Subdivision Algorithms

based schemes. In these schemes the vertices of the original mesh are not points of the final computed mesh. A representative approximating scheme for triangle meshes is the Loop algorithm [23] (see Table 1). Although from the subdivision perspective while the approximating schemes produce high quality surfaces and fast convergence speed, they are not suitable for the displacement mapping. In this case the coarse triangle mesh has to be tessellated according to a displacement map but the original triangle mesh can not be changed, only subdivided. On the other hand are the interpolation schemes where the vertex of the original mesh are also points of the final surface. A representative interpolating scheme for triangle meshes is the Modified Butterfly algorithm [24, 25]. This algorithm can be employed for the displacement map as the original vertices of the triangular mesh are not changed. In any case, both subdivision schemes, Loop and Modified Butterfly, are based on the same basic idea in which the neighbour information of each edge is employed to process it. Although for clarity reasons we will employ as a model the Modified Butterfly algorithm, we claim that the method we propose is valid for both subdivision methods and, in general, for all adaptive subdivision schemes in which the neighbour information is employed. In the following subsection a brief introduction to the Modified Butterfly algorithm is presented.

2.2 Modified Butterfly The triangulation scheme is refined through splitting each edge in two and reconnecting. The interpolation subdivision scheme is used to define a value associated with the new point of the planar triangulation by taking suitable weighted sums of nearby values. Two major cases have to be considered: regular vertices and extraordinary vertices. A regular vertex is characterized by a valence of 6 (the vertex is shared by 6 triangles) meanwhile an extraordinary vertex has a valence not equal to 6. The original Butterfly scheme [29] exhibits degeneracies when applied in a topologically irregular grid. These problems where overcome 1 with the Modified Butterfly algorithm [24, 25]. The Modified Butterfly subdivision scheme computes a new edge midpoint. Four cases have to be considered: 1. The edge connects two vertices of valence 6. The mask to be employed is depicted in Figure 1(a). The midpoint, indicated with a cross in the figure, is computed through the weighted sums of nearby values. The corresponding weights are indicated in the bottom of the figure.



) and a vertex 6-vertex. The mask to be employed for the 2. The edge connects a K-vertex ( extraordinary vertex is indicated in Figure 1(b). With: 1

In any case we have to take into account that in the subdivision schemes the extraordinary vertex can only occur at the topmost level of subdivision. The authors claim that the overall ‘fairness’ of the resulting shapes tends to be better with this scheme. It could be possible that for the displacement map the coefficients have to be analyzed

3

c

c

b

s2 s1 s3

a

d

a

s0

d q s4 s6

c

s5

c

b

(a)

(b)

c

e

e

c

(c)

1 a = − _____ 2

1 c = − _____ 16

1 b = − _____ 8

d=0

9 e = − _____ 16

Coefficient values

Figure 1: Modified Butterfly Subdivision Masks (a) Regular vertices (b) Extraordinary vertex (c) Boundary vertices

 

     

        " !     * ),+.-/1032546879':)3;=-*)8@? /1032346+37A'@)3;=< $# &% ('  ; BDCFE8GH  J I9K9K9KLI M

(1)

3. The edge connects two extraordinary vertices. In this case we take the average of the values computed using the appropriate scheme of the previous case for each endpoint. 4. Boundary edges are subdivided using the 1-dimensional 4 point scheme of Figure 1(c). A consequence is that two separate meshes, whose boundary is identical, will have a matching boundary curve after subdivision.

4

d

c

l

e a

k

b

f h

g

j

i

Figure 2: Neighbour information required for vertex insertion.

3 Tessellation Based on Neighbours Information The main objective is to make additions to the typical hardware rendering pipeline in order to generate surfaces including techniques such as displacement map rendering in hardware. To achieve this a coarse triangle mesh together with a displacement map are sent from the CPU to the rendering pipeline. New features have to be added to the rendering pipeline in order to combine this information with a detailed triangle mesh before the rendering step. Using this technique the communication requirements between CPU and rendering pipeline are reduced, whereas the final image can remain highly detailed. As we pointed out before, although a great interest has been focussed on subdivision surfaces only few hardware implementations have analyzed the problem of adaptive tessellation [17]. Specifically, the solution presented in [17] limits the vertex insertion decision to information contained in only the two vertices of each edge. For example, in Figure 2, the edge between vertices a and b is split taken into account the information of the extreme vertices a and b. This ensures that the possible cracking between neighbour triangles is avoided. The objective of this work is to expand this method in such a way that the neighbour information of each edge can be taken into account in each vertex insertion decision. In order to make this we can consider the tessellation methods employed in interpolation subdivision methods. Specifically, for the Modified Butterfly method (see Figure 1), the information involved on the subdivision of each edge embrace the triangles that share at least one of the vertices of the edge. For the example of  Figure 2 the edge between vertices and is split taking into account not only the information of the   . extreme vertices and but also the information of vertices  

I I9K9K9K

Then, each triangle to be tessellated requires the information of the adjoining triangles to be processed. In case of non-adaptive approximating tessellation, for example with the Loop algorithm [22], the information of the neighbours of each vertex and their corresponding evolution for a specific number of subdivision steps can be stored in a matrix. The CPU sends each triangle together with the neighbour evolution information. In order to reduce the amount of communications between CPU and graphics pipeline the triangles should be sent in a specific order [30] reducing the number of times that each vertex has to be sent. Obviously, for adaptive tessellation it is not possible to find a mathematical expression for neighbours evolution, as this evolution and the number of tessellation refinements are conditioned by the displacement map. Each triangle and its corresponding neighbours have to be sent from the CPU to the graphics pipeline in order to be tessellated. But, on the other hand, this would imply the

5

CPU

Adaptive

Standard

Tesellation

Graphics

Unit

Pipeline

Grouping

Graphics Pipeline

Figure 3: Generic Structure of the System

GROUP 2

a b

h

g

e c

f

d

i

GROUP 1 Figure 4: Vertices locations for two adjacent groups computation of the full mesh in the new hardware added to the graphics pipeline, which is obviously prohibitive due to storage requirements. The solution we propose is schematically presented in Figure 3. The neighbour triangles have to be grouped in the CPU in order to be sent to the graphics pipeline. These groups of triangles are processed in an adaptive tessellation unit to be rendered in the graphics pipeline. The number of triangles in each group has to be determined as a function of the available storage during the tessellation operation. Some considerations have to be taking into account due to the grouping strategy. Let us consider the masks employed for the Modified Butterfly (see Figure 1) and the two groups of triangles of Figure 4. The edges can be classified in three:

C

Interior edges. In this case both vertices of the edge are interior to the group. For example, the edge between vertices and in group 1 of Figure 4. The masks for ordinary and extraordinary vertices (Figures 1(a) and 1(b)) could be employed as all the neighbours information is available. 

Border edges. In this case both vertices of the edge are on the border of the group. Let us  considerer as an example the edge between vertices and  in group 1 of Figure 4. In this case the boundary mask (Figure 1(c)) is not suitable as it could produce cracking effects between  neighbour groups. This can be observed for the edge between vertices and  of Figure 4. 6



From the point of view of the group 1 the boundary mask would imply vertices , ,  and  ,  meanwhile from the point of view of group 2 the boundary mask would imply vertices , ,  and . This suggests the utilization of a mask which only takes into account the current working  edge (vertices and ) as in the solution presented in [17].

G

Exterior edges. In this case only one of the vertices is on the border of the group. As an example let us consider the edge between vertices and in group 1 of Figure 4. In this case only the neighbourhood information of the interior vertex is available which suggests two possible strategies: 



1. Employ the simple mask that only takes into account the current working edge (solution of [17]).

G

2. Analyze alternative masks that take into account the full information of node partial information of node . 

and the

As was indicated, no neighbour information can be considered in the border and exterior edges. Even the possible solution of overlapping groups can not be applied for the adaptive tessellation algorithms. For example, let us considerer that the neighbour triangles surrounding group 1 are sent together with it. Although the attached neighbour information for computing the border and exterior edges is available for the first tessellation, the problem arises when the following tessellations have to be carried out. This is due to the fact that the evolution of each triangle depends on the evolution of the neighbours. The problem is that no information is available for analyzing the evolution of the attached triangles. In the following sections the grouping task developed by the CPU (Figure 3) and the algorithms to be performed by the Adaptive Tessellation unit are detailed. After this, an architecture for the Adaptive Tessellation unit is presented.

4 Grouping Algorithm The speed of high-performance rendering engines based on triangular meshes in computer graphics can be bounded by the rate at which triangulation data is sent into the graphics pipeline. Some reordering algorithms [31] have been developed in order to reduce the amount of data to be sent. These algorithms are focussed on the generation of an unique strip of triangles in such a way that each vertex has to be sent a minimum number of times. The objective in our case is different. The communication requirements have to be reduced but, moreover, the number of bounding triangles of each group have to be minimized. In this way the number of edges that have to be split using a simple mask (with the information of only the two extreme vertices) is minimized. The grouping algorithm we propose attempts to reduce the number of bounding triangles, to cover the full mesh in an efficient way, to minimize the amount of information to be sent and to simplify the storage and data management of the adaptive tessellation unit (Figure 3). The group search and the contiguous concentric triangle construction algorithm is based on a central vertex strips around this central vertex selection. Moreover, the central vertices are selected in such a way that successive processing groups are contiguous and without holes (non-sent triangles) among then. In this way the collection of all groups constitutes a global group characterized by a bound of vertices. 





7

1   =NULL; 2 B = NULL; 3 = select a vertex(mesh); 4 while (vertices) 5 build group( ); 6 list updating(   ); 7 if(   ==NULL) v=select a vertex(B); 8 else v= select last vertex(  ); 9

= find group center(v); 10 

Figure 5: Grouping algorithm structure

2

The basic algorithm issummarized in Figure 5. In the initialization stages (lines 1 and 2) a list  of working starting points  and the list of bounding vertices of the global group are initialized. For the first processing group a random central vertex is selected (line 3). Once a central vertex is selected the  group of triangles around this vertex is selected (line 5), the list of working starting and the list of bounding vertices of the global group (line 6) are updated. To construct points  the second group a working starting point has to be selected from thelist  (line 7). For other than second group the working starting point has to be selected from the  (line 8). The next central vertex is selected from this starting point (line 9). This grouping process (from line 4 to line 10) is repeated while there are remaining non processed vertices in the mesh. In the following subsections the main steps of the algorithm are detailed.

2













2





4.1 Selecting concentric triangle strips around a central point





In this subsection the computations associated to the build group( ) function (line 5 in Figure 5) are indicated. With this function the group of triangles around a central point is selected. Specifically, the grouping process is based on the selection of concentric strips of triangles around . 









Each concentric triangles strip around can be defined by two lists of vertices (one specifying the interior border of the strip and the second one the exterior border) together with the interconnectivity between them. In Figure 6(a) the vertex is surrounded by a first strip of triangles defined    !   ! by the lists  and  . A second strip is defined by the interior list  "  and the exterior  .

  



 I. I9K9K9KLI I 9  I. I9K9K9KI I 9 I  I9K9K9KI.  I.  two In the algorithm, outlined in Figure 7, to build the concentric strips of triangles around   lists of vertices are employed:  , to keep the information of the interior vertices, and  to store the exterior vertices. Another global list,  $C #E , is employed to store the full list of vertices assigned to the current group. The Level counter list stores the number of elements of each concentric list  and  $C #E are initialized to the central point  , and the of vertices. Firstly (line 3), the lists    Level counter to . Employing the information of list  , the list  the connectivity between both  lists are obtained (line 5). The new vertices of list  have to be stored in the global  $C #E (line 6)  and the number of vertices of  in the Level counter list (line 7). In order to construct the next   contiguous strip of triangles the  list has to be initialized to the information stored in  (line 8). This process (lines 4 to 10) has to be repeated number rings times, where number rings is the number  list are of concentric strips to be included in the final group. The vertices included in the last  





considered the bounding of the group, B group (line 11). In the example of Figure 6(a) the B group is marked with a dashed line. In order to avoid holes among contiguous groups two complementary

8

B_group 45 46

44 24

43

42

23

22 41 25 21 9 26 8 40 7 27 11 10 1 20 39 6 12 5 38 28 19 2 3 4 37 29 13 18 36 17 14 15 16 30 35 31 33 34 32

(a) Level_Counter −> 1 9 1521 List −>

Child −>

1 2 3 4 5 6 7 8 9 10 111213141516171819202122232425 262728293031323334353637383940414243444546 9 5 3 1 3 3 2 2 3 1 0 3 3 2 3 1 3 3 2 3 3 2 2 3 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Sibling −> 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 12 1 1 1 1 1 1 12 1 1 1 1 1 1 1 1 1 1 1 1 1 1

(b) Figure 6: (a) Example of grouping algorithm (b) Group representation



 

functions (hole elimination() and cave elimination()) have to be included. These functions will be explained later on. In the following the construction of the  list is detailed (function build  ( )). 4.1.1

Contiguous concentric list of vertices and connectivity

 



In this subsection the computations associated with the build  ( ) function (line 5 in Figure 7) are indicated. With this function, detailed in Figure 8, the  list and the connectity among vertices in list  and  are computed.











Once the  list is obtained the connectivity among the vertices in  (Sibling list) have to be specified. The Sibling list stores the connectivity information among points of the  list. Specifically, only the connectivity with the following points of the list is specified. Note that the connectivity with the previous points can be deduced from this information, and, in this way, the communication requirements are reduced. A connectivity for -vertex in  list indicates that -vertex is connected to  -vertex of the same list. In the same way, a connectivity for -vertex in  list indicates that

C





C

9



C

C



1 build group( ) 2 3 List =   ;  =   ;  = NULL; Level counter = 1  ;  4 for(j=0; j number rings; j++) 5 build  ( ); ; 6 List = List  7 Level counter = Level counter  number vertices(  );  =  ; 8  = NULL; 9 10  11 B group =  ; 12 hole elimination(); 13 cave elimination(); 14 



Figure 7: build group( ) function 

C -vertex is non-connected to the following vertices. On the other hand, connectivity values neither equal to zero nor one indicates that a vertex is also connected to non contiguous vertex of the list. This   way, if a connectivity , assigned to C -vertex, is followed for a set of connectivities H I H I9K9K9K H I I9K9K9K  H  JI (  I9K9K9 K ) this indicates that the C -vertex is connected to C I C H  I9K9K9KI C H with   I9K9K9KI3 I3 " of vertices. As an example let us consider the connectivity of the fourth string    I. Figure 6(b). The sibling connectivity of   I9K9K9KLI.J is , that is, each vertex is connected with the consecutive vertex. But the connectivity of vertex  is I. (the followed by all the connectivity values until the first or  ). This means that the vertex 32 is connected to vertices and  . This construction procedure is summarized in lines 19 to 23 in Figure 8.

- I -  I -"

Another example of the sibling construction is presented in Figure 9. In this case vertex  is " associated connected to vertices    . This translates to a sibling connectivity of  to the  vertex. 





I. I.











After the  list and its sibling connectivity are constructed, the list  and the connectivity among both lists have to be computed. The algorithm analyzes all vertices  of  (line 3). All vertices of all triangles connected to  (triangles(  )) are neighbours of  , but only those not included in the List (previously processed vertices) are part of  (line 24). The values in the  list has to be ordered in such a way that connected vertices are stored consecutively. In order to clarify let us consider again the example of Figure 6(a). During the construction of the second strip of  ! and    triangles around the vertex the lists  and List are  "  respectively. Then, those vertices connected to  are  and then the list " .  is made by  











   I. I9K9 K9I.K II9 9K9JK9IKL I  II  9  I9K9K9K I. I. I. I9K9K9K I I 9  I  I9K9K9KI.  Once the list  is made up, the vertex connectivity has to be analyzed. Specifically, the con  nectivity among the vertex in  with the vertex in  (Child list). The Child list is the number of ver   tex of  connected to each vertex in  . Note that two contiguous points of  are connected to two  contiguous groups of children of  with only a unique common point between groups. In order to 

make the list (line 25) the triangles connected to each vertex    (triangles(  )) are analyzed. The number of vertices of these triangles not included in the generic List of processed vertices indicates the connectivity. To clarify let us considerer the example of Figure 6(a) and the corresponding lists  ! and  =  " summarized in Figure 6(b). The connectivity among  =    (second and third lines in List of Figure 6(b)) is given by children =  (second line in Child of Figure 6(b)). This means that the vertex (in  ) is connected with the first five 



  I. I9K9K9KI I 9  I  I9K9K9K I. I. I I. I. I. I. I: I  

10

1 build  ( ) 2  3 for(i=0; i number vertices( ); i++)  4 for(j=i+2; j number vertices(  ); j++)   intersection = vertices(triangles(  )) [vertices(triangles(  ))-vertices(triangles(  5 6 intersection = intersection - List; 7 if( intersection   NULL) 8 index =j; 9 break; 10  11   12 for(j=1; j =maximum(   ); j++)  candidates = vertices(triangles(  )); 13 14  15 if(   candidates &&   List)  =   ; 16 17 List = List   ; 18   19

  = index vertices(vertices(triangles(  )) ( List -  -  )) - i  0 ; 20 Sibling  1  ; 21 if (    != NULL) 22 Sibling= Sibling 

  ;  23  =  vertices(triangles(  )-List); /*    */ 24 25 Child = Child  number vertices(triangles( )-List); 26  27 

Figure 8: build 

11

 (  ) function

))];

Vi+1 Vi+2 Vi+3

Vi

Vi−1

Vi+4

L1

Sibling −> 1 1 2 3 1 1 1 1 Vi Figure 9: Non contiguous vertices connections inside string

 I  I  I A I   







points in list  ( ), the following vertex , with 3 children, is connected to the last mentioned point of  (vertex ) and two more points ( and  ). The following vertex, , with one child, is connected to vertex  , and so on. Interior points correction



For clarity reasons we have not presented before a slight modification that has to be initially performed in the  list in order to simplify the connectivity information. As we pointed out, consecutive groups of vertices of the  list (with a common vertex between groups) are children of consecutive vertices of the  list. The problem arises when this regular structure is broken. In this way it is possible that  successive points    of the  list follow this regular structure but that one of the children of the following vertex  is connected to one of the interior children,   , of vertex  with   . In this case the connectivity and data management com  children    ), plexity increase. To avoid this, the set of children of vertex  posterior to  (     all the children of  previous to the irregular  , and the set of children of vertex    child have to be identified (lines 4 to 15) and have to be included in the  list (line 16) and in the List (line 17) of processed data. In Figure 10(a) an example is depicted. In this case the    . Note that the vertex has three children list, indicated using a dark line, is  =     , the vertex and one child  but vertex breaks the regular structure and is connected  to vertex . The connectivity of vertices in is graphically indicated in Figure 10(b). The regular structure in which consecutive points of a list  (second row of data) are connected with consecutive groups of points of the  list (third row of data) is destroyed. The solution we propose is outlined   , and in this way the in Figure 10(c). The point is included in the  list,  =  regular connectivity structure (Figure 10(d)) between successive lists (second and third rows of data) is kept. In Figure 10(e) the List of vertices, the child and sibling connectivities are indicated. But changing the  data carries some implications over the previous lists of vertices. When the upper  , =   and child = row of triangles was analyzed the corresponding  =  " lists were employed. This means that the vertex is connected with three vertices of   ( ), that the vertex is connected to the two following vertices ( and ) and that the vertex is connected to the last three points of the list ( and  ). We could think that if this  list is changed the connectivity information would not be correct. However, changing the connectivity of previously computed triangle strips is not required. The correct connectivity can be obtained by checking not only the children of each row of data but the sibling information of the following row of data. Specifically, the location of interior nodes in a list can be detected by checking the sibling  ) connectivity. Let us consider a list made by nodes    where each node (



 has  sibling neighbours with connectivity (with and ). This means   that each node is connected with nodes . If a node of the set has 





 9I K9K9KI - - 5- ' I '@- I9K9K9KI ':- I9K9K9KI '@- I9K9K9KI 









'@-













 I I3









I. I. I. I  I







I. I. I. I. A



'





 I9K9K9KI H  I9K9K9K H H  '@- ' I9K9K9K '@- ' $ 



12



 I. I. I3 I. I  I











  I  I A  I 



'@- 9- I9K9K9KI '@ 







'@- 3-

':-

 I. I. I. I  I

H



' H  JI9K9K9KI H '@- ' I9K9K9KLI ':- '









13 12

14 5

3 4 1

2

6

L1

7

13 14

12

8

9

10

11

5

3

(c) 4

1

2

L1 7

6

8

9

10

11

12

13

14

1

2

3

4

8

9

10

11

5

6

7

(a) (d) 12

13

List −>

14

1

2

3

5

6

8

9

4

10

11

12

13

14

1 8

2 9

3 10

4 11

5

6

7

3 1 0

2 2 0

3 0 0

0 0

0

3

1

1

1

1

7

Child −>

(b)

Sibling −>

1 1 1

1 1 1 24 1 2 1 2 1 1 1 (e)

Figure 10: Interior point example: mesh (a) and connectivy (b). Alternative representation: mesh (c), connectivity (d) and lists (d)

  I  I A

I. I. I   L I   I  JI I I 

a connectivity greater than one it is an interior vertex, in other case it is a normal vertex. For the  list with child =  " is connected to an updated example of Figure 10(c) the  =     . The existence of whose sibling information is   = an interior node on the  list can be detected from the sibling connectivity. In this case vertex 2 of list  has a connectivity 1/2/4 which means that is connected to nodes , and . Node has a connectivity 1/2 which means that is an interior node meanwhile node has a connectivity which indicates that it is an usual node.



I. I. I3 I. I  I 



4.2 Bounding vertices and starting points detection

2  I





2

In this subsection the computations associated with the list updating( (line 6 in )function  Figure 5) are described. With this function the list of working starting points  and the list B of bounding vertices of the global group are updated. The algorithm is briefly outlined in Figure 11. 

Firstly the bounding of the actual group, B group, is computed (lines 4 to 9). The B group was 13

1 list updating(   ) 2 3 interior v = NULL; 4 /* Bounding of the group, B group */ 5 /*  B group */ 6 if( vertices(triangles( )  List) 7 interior v = interior v    ;  8 9 B group = B group - interior v ; 10 /* Bounding of the global  group, B */ 11 interior bounding = B B group; 12 B = (B B group)-interior bounding; 13 /*  interior bounding */ 14 if(  vertices(triangles( )) == non processed)  =     ; 15 16 B = B +   ; 17  18 

Figure 11: list updating(

2  I



) function

Group

Group 5 7 6

5

8

7

3

6

                                    4                                                                                            2 

1 B_group

8 3

                       4                                                                                                                                                                                                                                                                          2

1 B_group (a)

(b)

Figure 12: (a) Triangle full connected to B group (b) Attachment to the group initialized just after the construction of the group (Figure 7). But there is the possibility of interior nodes that should not be included in the bounding list. Specifically, the triangles connected to these vertices are interior, that is, all their vertices are included in the  $# of processed vertices. These triangles have to be included in the last built group before sending it to the graphics pipeline.

C E

K9K9KI I. I. I3 I. I9K9K9K

This can be easily observed in Figure 12. In Figure 12(a) the B group, depicted with dashed  . But, as it can be observed the vertex is an interior lines, is initialized to   triangle has to be included point, not connected with other points outside the group. The  in the group before sending it to the graphics pipeline. The real bounding of the group, B group, is indicated in Figure 12(b). In this case the interior point is eliminated from the B group.

 I. I3

After this, the bounding B of all processed groups has to be computed. For the first computed group the bounding B coincides with the B group. In the other cases, when one new group is attached to the previous computed groups the interior frontier between them has to be eliminated. Then the B can be computed taking into account the new B group (line 12) although the interior frontier (line 11) has to be eliminated. The two extreme points of this interior frontier, characterized by being non

14

1 find group center(v) 2 3 L(0)=v; = non processed(triangles(L(0))); 4 5 i=0; radius = 1;  6 while(number of vertices K) 7 i++; 8 L(i) = vertices(  )-B-L(i-1); 9 = triangles(L(i))-  ;  10 for(j=0; j number vertices(L(i)); j++) 11 /*    */ 12 temp =  ;  13 for(k=0; k radius-1; k++) temp = temp  16 if(temp  == 0) 17 if (radius == number rings) return  ; 18 radius ++; 19 break; 20    21 return(select a vertex(L(i/2))); 22 

vertices(triangles(temp));

Figure 13: find group center(v) function

interior points (line 14), have to be considered as part of B (line 16) and also as part of the list of working starting points (line 15). As will be shown later, the starting points are reference points for computing the new groups close to the previously computed triangles, allowing an efficient covering of the full mesh of triangles.

4.3 Central point for the following group construction



In this subsection the computations associated to the find group center(v) function (line 9 in Figure 5) are described. With this function a center vertex for the next group is obtained. The algorithm we propose to find a center is briefly presented in Figure 13. The basic idea is to search, from a point  , for a point that is surrounded by a specific number of triangles rings starting vertex of  (number rings) without overlapping with any group previously computed.

2









To avoid the overlapping a set of strings of triangles   , delimited by a set of strings of vertices C

  , are employed. As is schematically indicated in Figure 14(a) the first string    is initialized to the starting vertex (line 3). The set of non processed triangles connected to    is assigned to    a list  (line 4). The contiguous non processed string of triangles  surrounding the  triangles (line 9) and the corresponding outside string of vertex   (line 8) are calculated and so on. Each  center points has to be analyzed. To time a new list   C is computed the possible existence of ' compute this, all the candidates    C have to be studied (line 10) through the analysis of the triangles surrounding them (line 13). Specifically, the group of all triangles with vertices at distance ' number rings from have to be tested. If this group does not intersect with the B bounding then the ' is selected as the  point (line 17). If there is not '    C that verifies this condition the next - and   C , have to be calculated and so on. lists of data,   













To clarify this let us consider the construction of the second group in the example of Figure 6(a) which is detailed in Figure 14(b). The bounding B of the first group is made by vertices  " . The starting point to construct the next group can be any point in B (line 7 in 

  I. I9K9K9KI3 



15

v 45

B

46

Group T3

T3 T1 v

T1 T1 L(1) T1

T0 T0

T0

T1

T0

T3 T3

T1 T1 T3 T1 T1 T1 T3 T3 T3 T3 T3 T3

24

43 23

42

22

41 21 26 25 9 8 40 7 27 11 10 1 20 39 6 12 5 38 28 19 2 4 3 37 29 13 18 L(1) 17 36 14 15 16 30 35 L(2) 31 33 34 32

L(3) T3

T1L(2)T3

T1

44

T3

v0

(b)

(a)

L(3)

Figure 14: Search of a central point (a) Scheme (b) Example



C

 was selected. The   vertices that delimit the succesFigure 5). In this example the vertex sive strips of triangles are indicated in the figure. In this example a number rings=3 was employed that means that we are looking for a group with, at least, three unassigned strings of triangles around the central point . In the   list there exist three points, indicated in the figure with a circle, that can be employed as the center point. These points are surrounded by 3 strips of triangles without overlapping with the previously computed triangles. Once one point of the ordered list (line 10) that verifies this condition is detected no other points have to analyzed (line 17). In the example the first of the three points in the list is selected as the central point. With this central point a new group (Figure 7) can be built. 









C

A small modification over the general algorithm has to be taken into account. If the group to be made is close to the frontier of the triangles mesh it could be possible that a great number of lists  

have to be constructed in order to find a point. This can be avoided by just defining a maximum number K of vertices for each group (line 6). If list   is being processed when the number of

vertices K is reached, the central point could be selected, for example, from the central list   (line 21). In any case the optimum solution involves the searching of the best covering of the mesh by analyzing all the vertices of all the lists ( 

). 







C

H I H  J I9K9K9K C

C 

4.4 Complementary functions The functions hole elimination() and cave elimination(), employed in each group construction (see Figure 7), have not been previously presented due to clarity reasons. In the following the main computations associated with these functions are described. 4.4.1

Non assigned triangles in the construction of a group

In this subsection the computations associated with hole elimination() function (line 12 in Figure 7) are described. Some holes, that is, triangles not assigned, can appear in the construction of a group. This can be observed in Figure 15 where there are some unassigned triangles between the last built group (marked in clear grey) and the global group consisting of the previously built groups (marked in dark grey). However these hole points can be easily identified as they were included in the L(i) 16

Group

                                                                                                                                           BB_group                                                                                                                                                                                                                                                                                                                      L(1) Global                                                                                                                                            Group                                                                       L(0)                                                                                                                                                                                                                         

Figure 15: Hole identification 1 hole elimination() 2 3 for(i= number list-1; i  0; i --)    =   L(i) &&    List  ; 4 5 restricted build  ( ,    ); 6 List = List   ; 7 Level counter = Level counter  number vertices(  );  =  ; 8  = NULL ; 9 10  11 B group = B group  ; 14 

Figure 16: hole elimination() function



lists (line 8 of Figure 13) during the searching of the central point of the last built group. For the particular case of the example of Figure 15 the unique point of list L(1) has not been included in the last built group and is a candidate to be included in it before sending it to the graphics pipeline. 

The algorithm we propose to include these points in the group under construction is presented in Figure 16. All the L(i) lists (except L(0)) employed during the searching of the central point of the group have to be analyzed (line 3). The not assigned points of each list (line 4) are identified. To include these points in the group (line 5) a slight modification of the build  function (Figure 8) has to be employed. In this case only the hole points have to be considered as candidates to be attached to the group. Once the points are included, the lists have to be actualized (lines 6 to 9) in order to process the next hole points. Once all of the hole points have been attached, the list of bounding points of the group, B group, has to be updated (line 11).



17

B

B 5

5 4

4 9

9

T4

3

T2

3

B_group

T3 7

B_group

8

8

7 2

2

T1

6

6 1

1

(a)

(b)

Figure 17: Cave (a) Identification (b) Elimination 1 cave elimination() 2    = NULL; 3  4  = non  processed(triangles(B group)); 5 for(i=0; i number triangles(  );i++)     */ 6 /*  7 if(vertices( )  B group B) 8    =           ; 9   10 11 restricted build  ( ,   );  ; 12 List = List  13 Level counter = Level counter  number vertices(  ); 14 B group = B group  ; 15 

Figure 18: cave elimination() function

4.4.2

Non assigned strip of triangles between two groups

In this subsection the computations associated to the cave elimination() function (line 13 in Figure 7) are indicated. A strip of cave triangles can appear in the union between two groups. If these triangles are assigned to another new group, non neighbour information could be employed for their computation. It would be interesting to detect this situation in order to include this strip of triangles in the current group. This can be easily observed in the example of Figure 17(a). In this example the previous computed groups are indicated in dark grey while the actual group is marked in light grey. There is a strip of triangles       delimited by the previous computed groups (B frontier) and the actual group (B group frontier). These triangles have to be detected to be included in the current group obtaining in this way the distribution indicated in Figure 17(b). The algorithm we propose is presented in Figure 18. The candidates to be cave triangles are those non processed triangles connected to the B group of the actual group (line 4). Each of those triangles has to be analyzed (line 5) in order to find those fully connected to the B and B group borders (line 7). These triangles have to be assigned to the current group (line 8). Their vertices are appended to the last  list of the group (line 11) and the corresponding lists have to be updated (lines 12 to 14).

I I "I +



18

1 Adaptive Tessellation Unit() 2 3 while(1)  4 for(level=0; level level maximum; level++)  5 for(i=0; i number vertices(level); i++) 6 Edge1();  7 for(j=1; j vertex[level][i].children; j++) 8 Edge2(); 9  10  11  12 convergence(); 13  14 

Figure 19: Adaptive Tessellation Algorithm Structure

5 Adaptive Tessellation Algorithm Structure In this section a brief introduction to the adaptive tessellation algorithm is presented. Specifically, we will focus the presentation on the data flow we propose because, as will be shown later, the data storage and data management represent the main tasks to be solved in order to get an efficient implementation. The basic task developed during the adaptive tessellation is the subdivision of each edge of a set of triangles, and after this, the testing of the necessity of the subdivision on the basis of some specific conditions. The main problem of the algorithm, from a hardware point of view, is that the computation of each edge implies the utilization of not only the coordinates of the extreme points of the edge, but also the corresponding coordinates of the neighbours of these vertices. There is therefore the necessity of storing the neighbours information in such a way that it can be accessed in an efficient way. Moreover and taking into account that the adaptive tessellation has to be performed repeatedly over the full mesh, the resulting mesh obtained in each iteration has to be efficiently stored in order to be reused in the following iteration. The notation that was introduced to define a group in the previous section is adequate in order to access the required neighbour information each time a new edge is computed. This notation is based on the description of each mesh through the identification of strips of triangles around a center point, and the representation of each strip of triangles by the two strings of vertices that delimit it. The algorithm we propose to go through the mesh is based on the computation of the edges of the triangles along each strip before starting with the following strip. The inside string of vertices that delimits the strip of triangles indicates the order in which the edges have to be computed for a good covering. The algorithm we propose is schematically presented in Figure 19. The strings of vertices are computed sequentially (line 4) through the analysis of all vertices in each one (line 5). For each vertex   of each level all the children   , that is, all the connected vertices of the following string of data are analyzed. Specifically, the function Edge1() performs the computations related with the edge connecting vertex and the first child . For the following child the function Edge2() is employed. This function performs the computations related with the edge connecting the root vertex with the new child and the edge connecting the children and . The full mesh is consecutively processed until it is appropriately tessellated (line 12) accordingly to the precision of the displacement 











 I9K9K9KLI / 









19











45 46

44 24

43

42

23

22 41 21 25 9 26 8 40 7 27 11 10 1 6 20 39 12 5 38 28 19 2 3 4 37 29 13 18 17 36 14 15 16 30 35 31 33 34 32 (a) 1 2

3

4

3

5 I

II

IV

15 16 17

11 12 13 14 15 16 17 18 19

III

V

26 27 28 29 30 31 32 33 34 35 36 (b)

Figure 20: (a) Mesh example (b) Computations order map and the required precision on the screen [17]. As will be shown later on, this processing ordering is strongly related with the hardware implementation we propose. Specifally, the vertices to process each edge will be stored in FIFO (First-in-First-out) queues and this processing ordering permits an easy control over the queues, a good way of reemploying the data for the computation of sucessive edges and of covering the mesh. Let us consider the example of Figure 20 where the adaptive tessellation of the first group of the example we employed in the grouping algorithm section (Figure 6) is considered. In Figure 20(a) the group of triangles is depicted. As was explained, this mesh can be described by the lists of concentric rings of vertices around a central point. The first list (Figure 20(b)) is made by   , the second list  and so on. In order to process the data, the vertex (first list) and its children by   is processed starting from ( ) are firstly analyzed. After this the second list  the first vertex and its corresponding children (11,12,13,14,15). The edges already processed at this moment are indicated in the figure with dark lines.

 I. I3 I. I9K9K9K  I. I3 I. I9K9K9K 

 I. I3 I. I9K9K9K



Next consider the computations related with the vertex and its corresponding children (15,16,17). The edges to be computed and the order of computation are detailed in the right part of the Figure 20(b). The first edge to be computed (function Edge1()), indicated with a label I, involves the edges . The following pair of edges to be computed (function Edge2()) are edge (label II) and edge (label III). In the next call to function Edge2() the last pair of edges related with  (label IV) and  (label V). Once all these edges have been vertex are computed: edge computed the following edges to be computed involve next vertex and its children.

M 

  



 

20



 

An important characteristic of this way of covering the mesh can be outlined from this figure: the neigbours information required to compute one edge is mostly reused to compute the following edge. For example, the necessary neighbours to compute the edge are:

 

   

M    (2) A      J  note that four groups of data, each one from consecutive strings of vertices, are required. On the other hand, the necessary neighbours to compute the following edge   are:    

   (3)     







Note that for this specific example new data is not required for the computation of the second edge. This way of reemploying the data permits, as it will be shown later, reducing the number of accesses to the memory where the data is stored, avoiding in this way wait cycles to obtain all the neighbours information.

6 Detailed Tessellation Algorithm Previously we have focused our attention on the method of covering the mesh in an efficient way. In this subsection we will describe in greater detail the operations to be performed in the adaptive tessellation algorithm and, specifically, the representation of the newly tessellated mesh as a set of strings of triangles around a central point. As will be described in this subsection, the classification of the new mesh as a set of concentric triangles strips is not obvious and it requires a detailed analysis. The algorithm we propose is developed in Figure 21. Specifically, the computations to be performed for each strip of triangles are indicated. After the initialization of three auxiliary tables (line 1) all vertices of the level are analyzed (line 2). As discussed earlier (Figure 19), a different kind of treatment is required for the first child of each vertex (function Edge1()) and for the other children (function Edge2()). Specifically, the computations related with the first child are indicated in lines 3 to 12 meanwhile the other children are processed in lines 15 to 30. In the following subsections we will introduce the data management, the computations associated to the first child, the computations associated to the other children and the computation of interior triangles (those triangles whose vertices are included in the same string of vertices).

6.1 Data management As pointed out earlier, the vertices of each level are stored in an array that will be implemented with a FIFO (first-in-first-out) queue. The array is initialized to the string values in such a way that F[level][0] stores the first vertex of the string. After each vertex is processed a shift of one position is considered in such a way that the vertex to be analyzed is always in the first position of the array F[level][0]. The detailed operations to be performed in this shift operation (line 32) are indicated in Figure 22. Specifically, the shifting operation is performed in the four levels of arrays that have to be taken into account during the processing of each strip of triangles, that is, F[level-1] (for clarity reasons it is not indicated in the algorithm), F[level] (line 32), F[level+1] (line 28) and F[level+2] (lines 13 21

1 Table1 = NULL; Table2 = NULL; BrotherTable = NULL;  2 for i=0; i number vertices(level); i++) 3 New vertex1 = Butterfly(F[level][0], F[level+1][0]); 4 i =Test(F[level][0], F[level+1][0], New vertex1); 5 if (F[level][0].children==1) 6 SingleChild(Table1, Table2, New vertex1, i ); 7 break;  8 9 else 10 if (Table2==0) LevelDecision2(i , i  , i , i  );  11 else LevelDecision3(Table2);  12  13 ShiftRight(level+2, F[level+1][0].children);  14 for (j=1; j F[level][0].children; j++) 15 if(NOT(BrotherTable   NULL && F[level+1][1].ring  1)) 16 New vertex2 = Butterfly(F[level][0], F[level+1][1]); 17 i  =Test(F[level][0], F[level+1][1], New vertex2);  18 else j--  ; 19 if (F[level+1][0].ring   0) 20 New vertex3 = Butterfly(F[level+1][0], F[level+1][1]); 21 i = Test(F[level+1][0], F[level+1][1], New vertex3); 22 if(BrotherTable[0]   NULL) BrotherButterfly();  23 if(j   F[level][0].children-1) LevelDecision1(i , i  , i ); 24 if (F[level+1][0].ring  1) brother( );  25  26 else i = 10;  27 ShiftRight(level+2, F[level+1][0].children); 28 ShiftRight(level+1, 1); 29 ShiftRightBrotherTable(1);  =  ;  =   ; 30 31  32 ShiftRight(level, 1); 33 

Figure 21: Detailed Adaptive tessellation algorithm

22

1 2 3 6

ShiftRight( , )

F[ ][



 



] = F[ ][

   ];

CH

Figure 22: ShiftRight( , ) function

V1 2

3

i4

New_vertex2 i1 i2

V1 3

i1 New_vertex1

New_vertex1 V2 14

15 V3 i3 New_vertex3

V2 15

(a)

New_vertex2 i2 i3 16 V3 New_vertex3

(b)

Figure 23: (a) First child computation (b) Following children computation and 27). As an example, in line 13 the shift operation is performed in such a way that the non useful neighbour information of level+2 to be employed in the Butterfly operation is discarded. This management of the arrays of data corresponds with the control that has to be performed over the FIFO queues that store the different levels of data.

 are stored in consecutive positions of In a general case the children of each vertex of     but there is one kind of exception that has to be detected. This corresponds with the array   the case in which some level reordering has to be performed to avoid irregular connectivities between strings of vertices. Let us consider again the node of the example of Figure 10. Its reordering implied some irregularities in the upper string of vertices. Vertex is connected to the non consecutive vertices and . Then, the detection of this irregularity (line 15) permits avoiding the computation of and jumps to the real edge (line 18). the non real edge











  





6.2 First child We will consider firstly the computations related with the first child (function Edge1()) of the vertex F[level][0] to be processed. In Figure 23(a) the notation we will employ is indicated. In this example the first child of vertex , that is, vertex , is being processed. Once the midpoint, New vertex1, is computed a test has to be made in order to determine if the splitting is performed. The decision is labeled as , where if there is not splitting and if the edge is split. In this figure the notation employed for the previously computed edges is also indicated. The level decision of New vertex2 and New vertex3 are denoted as and respectively.

C

C  



C

C"

C 

The New vertex1 coordinates computation (line 3) involves the vertex F[level][0] and the first child which is also stored in the first position of the level+1 array, F[level+1][0]. Once the splitting test is performed (line 4) the result is stored in the variable. After this, the concentric string structure of the new mesh has to be updated. As we pointed out, this is not easy and it requires a detailed analysis in which each vertex have to be assigned to a string (level) of vertices. This level decision is conditioned by the surrounding decisions where we have classified three possible cases:

C

23

1 2 3 4 5 6

SingleChild(Table1, Table2, New vertex1, i )



Table1 = Push(New vertex1); Table2 = Push(i ); ShiftRight(level,1);



Figure 24: SingleChild(Table1, Table2, New vertex1, i ) function

1. If the number of children of the current vertex is only one (line 5) no decisions can be performed at this moment (line 6) until the first child of the next vertex is processed. As is indicated in Figure 24, the information is stored in two tables (Table1 for the vertex information and Table2 for the value) and the F[level] array is shifted in order to process the next vertex. Once the storage is performed the next vertex of the string has to be computed (line 7). An example is schematically indicated in Figure 25(a). In this figure the original vertices of the mesh are indicated in boxes labeled with numbers, the new midpoints are labeled with letters, and the non existence of midpoints was indicated with empty boxes. The non processed midpoints are indicated in dashed boxes. The group of vertices whose level decision has not been still performed are surrounded by a dashed box. In this example the edge –  is being processed. Once the test is performed and the New vertex1 is identified as a vertex of the new mesh, the information has to be stored (as it is indicated in Figure 25(b)) to be processed later on.

C



2. If the number of children of the current vertex is not one (line 9) and the previous vertex has more than one child (Table2 is empty), the operations assigned to the LevelDecision2 function is performed (line 10). An example is indicated in Figure 25(c). In this example the first child of vertex (with three children) is computed. The group of vertices whose level decision has not been still performed are also surrounded by a dashed box. In this step some level decisions  can be determined, particularly those of vertices ,  , , and New vertex1. This is outlined in Figure 25(d) where these vertices are indicated by a dashed box. As is indicated in the figure, the , , and decisions have to be considered in order to make the level decisions. The computations to be performed in this LevelDecision2 function (line 10) are detailed in the Appendix A. Specifically, the Level, Children and Sibling classifications are developed.



C C C"



C+

3. If the number of children of the current vertex is not one (line 9) and the previous vertex has only one child (Table2 is not empty), the operations assigned to the LevelDecision3 function is performed (line 11). An example is indicated in Figure 25(e). In this example the first child  of vertex (with two children) is computed and it can be observed that previous vertex has one child (whose computation was developed in Figure 25(a)) and the corresponding information was stored in the supplementary tables. In the Figure 25(f) the decisions labeled as , ,  are employed to compute the level decisions of the system of vertices surrounded by the dashed box. The computations to be performed in this LevelDecision3 function (line 11) are indicated in Appendix C.







C  K9K9K C

6.3 Following children

 C

In Figure 23(b) the notation we will employ is indicated. In this example the second child of vertex , that is, vertex , is being processed. In this way two new vertices have to be computed, New vertex2 with decision and New vertex3 with decision .

C"

24

d

3

e

4

5 Table1

Sibling −>

43 23

42

78 77 22 75 41 76 79 74 25 21 55 9 26 8 53 73 40 58 56 54 2781 11 1057 1 51 7 7220 39 60 6 82 59 49 47 83 12 38 5 48 50 28 64 61 2 19 84 4 63 37 29 13 65 67 3 18 36 14 68 9017 15 16 30 85 86 35 89 31 88 87 33 34 32

78 77 22 75 41 76 79 74 25 21 55 9 26 8 53 73 40 58 56 54 2781 11 1057 1 51 7 7220 39 60 6 82 59 49 47 83 12 38 5 48 50 28 64 61 2 19 84 4 63 37 29 13 65 67 3 18 36 14 68 9017 15 16 30 85 86 35 89 31 88 87 33 34 32

80

80

Vertex −>

44 24

1 47 59 11 25 46 27

3 2 60 12 80 82

48 67 61 64 26 28

49 15 63 13 81

6 16 65 14 83

51 89 68 85 84

54 90 86 31 29

56 17 87 88 30

57 4 50 5 19 72 21 73 7 53 8 55 9 58 10 33 34 35 18 37 38 20 40 41 42 75 74 76 23 77 79 32 36 39 22 43 44 24 78

9 2 1 2 2 0 0

7 5 2 4 0 0

2 2 3 2 1 0

2 5 3 3 2

6 0 2 1 2

2 1 2 1 1

3 1 3 0 0

3 4 2 0 0

3 0 0 2 4 1 4 2 1 2 2 1 4 1 1 1 0 0 1 0 0 0 0 0 2 1 1 1 4 2 2 0 0 0 0 0 0 2 1

1 1 1 1 1/2 1 1 1

1 1 1 1 1 0

1 1 1 1 1 1 1 1 1 1 1 1 1

1 1 1 1 1

0 1 1 1 1

1/2 1/2

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 1

1/2/3

Figure 27: Tessellated mesh

28

4

4

3

2

2

2

2

13

14

68

15

16

90

17

4

3

3

2

85

86

87

89

5

4

4

4

3

30

31

88

32

33

3

18

3

34

3

35

Figure 28: Detailed example of level decision procedure

 

A 

The first row of data was processed and classified during the computation of the upper string of  have been already partitioned. triangles. This way it can be observed that edges and On the other hand, the level classification of this row of vertices have been already developed. The level of each vertex is indicated in the figure as a number over the corresponding box.

J     J 



In order to find the level of each vertex the tables presented in Appendices A, B and C can be employed. For example, let us consider that the first child of the root was computed and that the following child ( ) is being processed. As this is an intermediate child the table 11 can be employed. is employed. In our example the already As in this case the three edges where partitioned input computed vertices are with level  , with level   and the intermediate  vertex New vertex1 = 86 with level . From the table the following results are obtained:



  



 



BB EE  ! "  "     



 





 



(4)

In the same way the other vertices can be classified by applying the rules we present in the appendices. This classification method has an easy intuitive interpretation. As can be observed in the figure each time a vertex has to be classified the levels of the corresponding roots are analyzed. The vertex level is calculated as its the minimum root level plus one. This way, in the example all the   ) are surrounded by vertices with level 3. roots of the first row with level 2 (

 I  I JI



following the classification method develA specific treatment was performed over node oped in the appendices (see Figure 28). This level assignment was made in order to avoid irregular connectivities between consecutive strings of vertices (see the example of Figure 10 in which the level of node was changed in order obtain a regular connectivity structure).



The level decision computations permits the classification of vertices in strings in order to be stored (Vertex). Similar computations, introduced in the appendices, have to be performed in order to obtain the connectivity between strings (Child) and inside each string (Sibling).

Extension to Alternative Subdivision Schemes In the procedure previously presented each triangle is subdivided in function of the number of splitting edges accordingly to the scheme presented in Figure 29(a-c). Figure 29(d) shows and alternative way  for tessellating when two edges have to be split. In this case a new internal vertex is defined. This tessellation strategy was proposed in [17] to avoid the long thin triangles that appear in the simple tessellation process in which each midpoint is computed in function of the information of the extreme points of the edge. In case this problem appears in the extended tessellation (in which neighbour 29

Vz

(a)

(b)

(c)

(d)

Figure 29: Triangulations used for tessellation: (a) Three edges are split (b) Two edges are split (c) One edge is split (d) Alternative schemes when two edges are split From CPU Butterfly Processor

Memory

Test

Ordering Strip

Figure 30: Block diagram of the architecture 

information is employed) our method can be also employed. In order to include the point the classification tables (level, Sibling, Child) have to be substituted. As an example, in appendix D the level, Sibling and Child classification tables for the LevelDecision1 function are indicated.

7 Architecture for the Adaptive Tessellation Figure 30 shows the block diagram of the architecture for adaptive tessellation. The architecture has four modules: 1) Memory unit, 2) Butterfly processor, 3) Test unit and 4) Ordering strip unit. The incoming mesh is stored in a memory unit in order to be processed. This memory unit is also employed for the storage of the intermediate processed meshes and, on the other hand, for the management of the data. This way four consecutive strips of vertices are available for the second unit (butterfly processor) in such a way that the waiting cycles of this unit are minimized. The strips of vertices are processed by the butterfly processor where the coordinates of the midpoint candidate are obtained. These coordinates are delivered to the test unit where the candidate midpoint is analyzed to decide if the edge is finally split. The decisions together with the corresponding coordinates (if the splitting is performed) are introduced in a final unit, the ordering strip unit, where the vertices are reordered in strings of concentric vertices. The final mesh is stored in the first unit memory in order to be processed again. The recursive processing of the mesh is repeated until the mesh is fully tessellated accordingly to the displacement map. Specifically, the test unit should indicate when some convergence condition is reached in order to start with a new incoming mesh from the CPU. In the following subsections the structure of each module is detailed. 30

7.1 Butterfly Processor In this subsection the structure of the Butterfly processor is schematically presented. This processor computes the coordinates of the midpoint of each edge accordingly to the coordinates of the vertices of the edge and their first order neighbours. Accordingly to the operations to be performed in the Modified Butterfly algorithm (see section 2.2), the computations to be performed for the subdivision  of an edge with extremes and are:

;   ;

;  ;     K   (5) C E       K             ;   and the vertex has neighbours   I9K9K9KI ;    .  where the vertex has neighbours  I9K9K9KI   On the other hand, the set of coefficients  to be used for the neighbours of both extreme vertices  ). Then, different sets of  ( or ) depends of neighbours of each vertex ( and ; on the number ;       coefficients (  and ) are required if . Some considerations have to be taken into account about correct coefficients to be applied to each neighbour of each central vertex. The vertices   meanwhile vertices around are around are consecutively ordered taking as a starting point   . Note that the butterfly coefficient values (equation 1) for a ordered taking as a starting point 

























vertex with K neighbours verify:

 ; '   '  H   I9K9K9KI  

(6)

Therefore, neighbours of each vertex can be arranged in a clockwise or counter clockwise order as the same result will be obtained. The operation to be carried out in the butterfly processor (equation 5) is basically a sum of products. The generic structure of the architecture we propose is presented in Figure 31(a). It basically   consists of a set of   multipliers where the products of the neighbour coordinates (  ,  ) by the corresponding coefficients (    ) are performed. The maximum number of neighbours for  vertex, , determine in this design the number of multipliers of the system. The   outputs of the multipliers are introduced in a final adder in order to obtain the coordinates of the point (note that the division of equation (5) is a simple shift operation).



 ; I ;



As is indicated in the figure and in order to introduce the neighbours of each vertex in the correct multiplier, some previous sorting stage is required. As an example let us considerer again the consecutive computation of edges and of our example (see Figure 20). The four strips of data arriving to the butterfly processors are respectively indicated in Figure 32(a) and 32(b). The data distribution around both edges is indicated in figure 32(c) and 32(d) together with the coefficients assigned to each vertex. For example, vertex has six neighbours and the coefficients to be employed   . In case of edge  " are these coefficients are respectively assigned to   "  meanwhile for the edge to  . This translates to a simple shift operation. As the reordering is mainly a control task we will not detail it in this work.

 

  I9K9K9K 

 

( 

 

 I  I I3 I I:

 I I3 I I. I 

In order to complete the presentation the structure of each multiplier of Figure 31(a) has to be developed in a greater detail. In figure 31(b) the multiplier associated to the neighbour  of vertex is indicated. The coefficient to be employed in the multiplication depends not only on the i-index, but also on the number of neighbours of the vertex (note that the mask to be employed depends on the number of neighbours of the vertex). This means that each multiplier has a specific table (reflecting the fact that the i-neighbour  is computed on it). The possible coefficients associated  to a i-neighbour,       are stored in the table and selected in function of the number of   . The selected coefficient together with the  coordinates neighbours of , that is,   are introduced in a multiplier.

 " I  + I9K9K9KI 

C

I9K9K9KLI

31



Neighbour(b)

Neighbour(a) a0a1 ak a −1

Ka

b0 b1

bk b−1

Sorting

Sorting ...

...

ka

* S0

ka

ka

...

* S1

Kb

...

...

kb

kb

* S0

* S m−1

...

* S1

...

kb

* S m−1

...

2m ADDER

Coordinate (a) Ka

ai Table

*

ka

3 4 5 6 7 . . . m

. . .

Si (b)

Figure 31: (a) Butterfly processor (b) Multiplier structure

7.2 Memory An important attention has been put on the storage module of the design. In fact, the storage and data management constitute the main problems to be solved to obtain an efficient implementation of the algorithm. This is due to the fact that the butterfly processor requires the information of up to   vertices in order to split each edge. This could imply, if a randomly storage memory is employed, the necessity of   accesses to the memory and a complex table for the connectivity storage with difficult and expensive actualization.





In order to process each edge of the mesh, the butterfly processor requires the information of all the neighbours around the extreme vertices of the edge. These vertices are assigned to four consecutive strings of vertices that define the mesh. All edges are processed, as it was presented in section 5, covering a strip of triangles before starting with a new strip. This implies that all data of each of the four contiguous strings of vertices will be required consecutively before starting with a new strip of triangles. Then, the data has to be stored in such a way that an easy access to the strips

32

1

1

2

3

4

2

14

15 16

31

32 33

3

4

15 16

17

33

(a)

(b)

6

6

7

S2 17

S2 4

S2

6

33

S 1 S 71 16

32 7

3 1

S0

6

S3

S 65

1

4

15 31 7 S4

2 S 64

14 7 S5

7 S6

S0

3

2

S 64

S3

6

S0

6

S 1 S 41 17

7

6

S3 4

17

6

S0 16

33 S 42

15 S 65 S 43

S 60 S 61 S 62

S 63 S 64 S 65

S 70 S 71

S 72 S 73 S 74 S 75 S 76

S 60 S 61 S 62

S 36 S 64 S 56

S 40

S 41 S 42 S 43

15

4

3

33

16 17

1

3

17

16

17

1

2

16

3

32

31 14

2

4

2

15

(c)

15

16

3

15

33

(d)

Figure 32: Input data for edges (a) 3-15 and (b) 3-16. Neighbour distribution for edges (a) 3-15 and (b) 3-16 of vertices could be developed. The architecture we propose is depicted in Figure 33. Three different memories (Vertex, Child and Sibling) are employed to store the vertices, the corresponding children and the sibling information. As a proposal we employ a  vertices per word memory where  is the maximum connectivity of a vertex (probably and due to the high word size the memory should be made by a bank of  memories). This is a mere proposal as an extended simulation would be required in order to determine the appropriate word size of the memory. In any case the method would be also as the maximum valid independently of the size choice. In the example of the figure   connectivity of each vertex was estimated as .





 9 



H

To optimize the data access the information has to be kept in a coherent way in the three memories. Specifically, if a vertex is stored in address of the vertex memory, the corresponding child and sibling information are also stored in address of the Child and Sibling memories respectively. The best storage would imply that the information associated with consecutive vertices of a string would be in consecutive positions of the memory. But this distribution is possible only for the initial mesh (coming from the CPU) as during the subdivision of the mesh the new strings of vertices are obtained in sections.

H

The storage scheme we propose is based on the storage of the sections of strings as soon as are available in consecutive positions of the memory. This way a set of memories (indicated as map of addresses in the figure) to store the addresses of successive sections corresponding to the same string is employed. Specifically, the map of addresses of the data corresponding to each string of vertices (indicated in the figure as string memory) is stored in a memory . As usually the number of vertices in each string section do not fit with the word size of the memory, a mask should be employed to indicate the part of the word that stores the correct information.

C

C

33

C

Mask

MEMORY OF VERTEX MAP OF ADDRESSES

000 1 2

String 0 Mask Address 1000000000

000

String 1 0111111111 000 . . .

Address

010 21 22 23 24 25 26 27 28 29 30 011 31 32 33 34 35 36 37 38 39 40

1111111111 001 1111100000 010 . . . String 3 0000011111 010 1111111111 011 1111110000 100 . . .

MASK AND BARREL SHIFTER

Fv0

m+1

Fv1

m+1

Fv2

m+1

Fv3

100 41 42 43 44 45 46 MEMORY OF CHILD 000 9 5 3 1 3 3 2 2 3 1 001 0 3 3 2 3 1 3 3 2 3

String 2

m+1

3 4 5 6 7 8 9 10

001 11 12 13 14 15 16 17 18 19 20

010 3 2 2 3 2 0 0 0 0 0 011 0 0 0 0 0 0 0 0 0 0

MASK AND BARREL SHIFTER

m+1

Fc0

m+1

Fc1

m+1

Fc2

m+1

Fc3

100 0 0 0 0 0 0 MEMORY OF SIBLING m+1

000 0 1 1 1 1 1 1 1 1 1 001

1 1 1 1 1 1 1 1 1 1

010 1 1 1 1 011 1

1/2

1/2

1 1 1 1 1

1 1 1 1 1 1 1 1

MASK AND BARREL SHIFTER

Fs0

m+1

Fs1

m+1

Fs2

m+1

Fs3

100 1 1 1 1 1 1

Figure 33: Memory unit architecture



9        

To clarify let us consider the data indicated in Figure 33 that corresponds to the group exam! . In ple of Figure 20. The string 0 of vertices is stored in address with mask  the memory data the information relative to point is identified. The string 1 of vertices is stored  . In the memory data the information relative to points in address with mask    !   are identified. The string 2 of vertices is stored in addresses with mask  and ! . In the memory data the information relative to with mask   " is identified. points 

  I. I3 I. I  I I. I JI   9 I  I9K9K9KI.

 9    





This information is stored in an intermediate set of FIFO (first-in-first-out) queues to be introduced in the butterfly processor. As four strips are required three different sets of four FIFO queues are required for keeping the vertex (labeled with Fv), the children (labeled with Fc) and the siblings (labeled with Fs) information. The mask information has to be employed in order to obtain an efficient management of the information. Let us consider the example of Figure 33 where the address of the first strip section of  . This means that the strip section is stored in address string 3 is and its mask  and that only the five right positions of the word contains useful data. Specifically the corresponding  vertices are where the vertex is the first to be processed. The mask information is employed in a normalization unit (basically consisting of a barrel shifter) where the input data   is shifted to the left five positions in such a way that the block of  useful data can be easily identified. The  output data is stored in a FIFO queue in order to be employed by the butterfly processor. Taking into account that in the figure the data flows to the  " right, this means that the corresponding FIFO queue would store  where the data is in the right position prepared to be the first data to be introduced in the butterfly processor.

 9    I. I.  I. I. I I I I I.  I. I.  I. I:

 9



 9 



I I I I I.JI. I.  I@ I. 

In the following a more detailed description of the FIFO queues is presented. Let us con34

0 1 9 1 10 1 9 1 3

1 8 2

1 7 2

1 6 3

1 5 3

1 4 1

1 3 3

1 2 5

1 20 1 19 1 18 1 17 1 16 1 15 1 14 1 13 1 12 1 11 3 2 3 3 1 3 2 3 3 0 1 30 1 29 1 28 1 27 1 26 0 0 0 0 0

Sibling

Vertex Child

Figure 34: Example of distribution of data in the FIFO queues 0 1 9

String 5 1 10 1

1 9 3

1 8 2

1 7 2

1 6 3

1 5 3

1 4 1

1 3 3

1 2 5

1/2 25

2

1 24 3

1 23 2

1 22 2

1 21 3

1 20 1 19 1 18 1 17 1 16 1 15 1 14 1 13 1 12 1 11 3 2 3 3 1 3 2 3 3 0

1 40 0

1 39 0

1 38 0

1 37 0

1 36 0

1 35 1 34 1 33 0 0 0

1 10 1

1 9 3

1 8 2

1/2 32

0

1 7 2

1 6 3

1 5 3

1 4 1

1 3 3

1 2 5

131 1 30 1 29 1 28 1 27 1 26 0 0 0 0 0 0

Figure 35: Preparing the FIFO queues for later computations

 I9K9K9K I 9

sider the FIFO queues data flow for the example of Figure 20, specifically the data flow required for ! the computation of the second strip of triangles delimited by the two strings of vertices  "  and  . To compute the edges of this strip of triangles the four first strings of vertices   ! ,  " and  " . The first part of each string is are required:  ,  ! with masks stored, as it is indicated in the map of addresses, in addresses   . For clarity reasons we will consider that the  FIFO queues are initialized with these values as it is indicated in Figure 34. The cells of the FIFO queues are represented as boxes. As is indicated in the low part of the figure in each cell we summarize the content of the three cells of information, corresponding to the three different sets of FIFO queues of vertex (inside), the children (down) and sibling (left) information.

I9K9K9K I.

 I9K9K9KI 9 I9K9K9KLI.   I9K9K9K I3    JI5  JI5  I5  9        JI5 I I5    (

 9 

$  9

We have included a double size FIFO queue in which the left  cells are employed as buffers. That is, if a set of  cells are empty new available data is requested to the memory. In our example the four FIFO buffers are empty but only the third and fourth strings of vertices are still not completed. The addresses of memory to get new data for the third and fourth  respectively and the masks   . This data, introduced strings are  in the third and fourth FIFO queues, is indicated in Figure 35 in dashed lines. These two accesses to the memory can be performed in the following two clock cycles meanwhile the butterfly processor is computing the first set of available data of the FIFO queues. On the other hand and in order to avoid later waiting cycles we can prepare the free non-used FIFO buffers (first and second rows) in order to compute the following strip of triangles: the third strip. The second, third, fourth and fifth strings of vertices would be required for these computations. We will consider that the second, third and fourth strings of data will be stored again in the second, third and fourth FIFO queues. Then, the next two

 9JI5

9    JI

35

1 20 3

1 19 2

1 18 3

0 1 9

0 1 9

1 10 1

1 9 3

1 8 2

1 7 2

1 6 3

1 5 3

1 4 1

1 3 3

1 2 5

1 10 1 9 1 3

1 8 2

1 7 2

1 6 3

1 5 3

1 4 1

1 3 3

1 2 5

1 17 3

1 16 1

1 15 3

1 14 2

1 13 3

1 12 1 11 3 0

1/2 25

1 24 3

1 23 2

1 21 3

1 20 3

1 19 2

1 18 3

1 17 3

1 16 1

1 15 3

1 46 0

1 45 0

1 44 0

1 43 0

1 41 1 40 1 39 1 38 1 37 1 36 1 35 1 34 0 0 0 0 0 0 0 0

1 33 0

1/2 32

1 31 0

1 42 0

2

1 22 2

0

1 14 2

Butterfly Processor (a)

1 20 3

1 19 2

1 18 3

1 8 2

1 9 3

1 8 2

1 7 2

1 6 3

1 3 3

1 2 5

1 10 1

1 9 3

1 3 3

1 4 1

1 3 3

1 2 5

1 17 3

1 16 1

1 15 3

1 14 2

1 13 3

1 24 3

1 23 2

1 22 2

1 21 1 20 1 19 1 18 1 17 1 16 1 15 3 3 2 3 3 1 3

1 17 3

1 16 1

1 15 3

1 46 0

1 45 0

1 44 0

1 42 1 41 0 0

1 40 0

1 39 0

1 33 0

1/2 32

1 31 0

1 37 0

1 6 3

1 5 3

1 4 1

0 1 9

1 10 1

1 38 0

1 7 2

0 1 9

1 36 1 35 1 34 1 33 0 0 0 0

0

1 14 2

Butterfly Processor (b)

Figure 36: FIFO queues data distribution to processes (a)

M 

and (b)

M 

clock cycles can be employed to load again the second string and to start loading the fifth string in the first row of cells (as in our simple example we do not have any fifth string data, we indicate the corresponding cells in dashed lines). In order to complete the presentation we will consider the evolution of the FIFO queues between two succesive edge computations. In Figure 36(a) the data distribution for the computation of of our example (Figure 20) is indicated. On the other hand, in Figure 36(b) the data edge distribution for the next edge to be computed, , is depicted. As was indicated in Figure 32(a), ,   and the four strings of data required to process the edge are:   ,  " . These values are stored in an input buffer of the butterfly processor as it is indicated in  the right part of the Figure 36(a).

 

  ! 

J I.  I.

 

 I. I3

 I  I

 I. I3

A I  I  I

In the next cycle and as it is indicated in Figure 32(b), the four strings of data required to ,    and  " . The new FIFO distribution is edge are:   ,  process the indicated in Figure 36(b). These values are indicated in black boxes in the input buffer of the butterfly processor. Note that the following edge to be processed will be edge , this way the , and have to be kept in the butterfly processor. These values are indicated in the figure in thin boxes.



  

A J

As was previously mentioned, in order to introduce the neighbours of each vertex in the correct multiplier of the butterfly processor (Figure 31(a)), one previous sorting stage is performed. In Figure 37 the data sorting from input buffer of the butterfly processor for the computation of the edge is schematically indicated. Specifically, the six neighbours of vertex and the seven neighbours of vertex have to be sorted in order to apply the correct weight coefficients to each one.

 



7.3 Test In the solution presented in [17] four tests are performed over each edge in order to determine if the splitting operation has to be performed. These tests, which are based on the analysis of the candidate midpoint and the extreme vertices of the edge are basically:

36

INPUT BUFFER 1 4

3

2

17

16

15

33

32

31

SORTING (Neighbours of Vertex 3)

14

SORTING (Neighbours of Vertex 15)

15 16 17

4

1

2

3 16 33 32 31 14 2

S 60

S 63

S 64

S 65

S 70 S 71 S 72 S 73 S 74 S 75 S 76

S 61

S 62

Figure 37: Sorting in the butterfly processor Surface normal variance test. Local area average heigh test. View dependent resampling. Refinement limit test. These tests are focussed on the analysis of the midpoint and the extreme points of the edge. In the new algorithm we propose, the midpoint coordinates are calculated in function, not only of the extreme points, but also on their corresponding neighbours. In the same way, the extension of the previous tests to employ the information of the neighbour information should be considered.

7.4 Ordering Strip The output of the test unit is introduced in the ordering strip unit to obtain the correct lists information (Vertex, Children, Sibling) that describes the new tessellated mesh. Specifically this unit develops the level vertex classification and the obtaining of the corresponding lists of children and the sibling connectivities. This involves the application of the corresponding classification tables (presented in subsection 6). For example, the detailed architecture required for the implementation of the level classification in the LevelDecision1 function is depicted in Figure 38. The functions to be implemented are detailed in table 11 in Appendix B. It basically consists of three adders, a minimum selector, two input multiplexors and three output multiplexors in which the three required outputs are obtained. As was previously indicated during the computation of each strip of triangles the strings of vertices of the tessellated system are obtained in sections. Then, auxiliary memories are required for keeping the addresses of the consecutive sections that constitute a string. On the other hand the computation of each triangle generates vertices of at most two levels (together with the already computed root vertices) and, it can be ensured that the computation of the contiguous triangle of the same strip will maintain the continuity of, at least, one of the levels. In this way, two FIFO queues can 37

l V1

2

1

l V2

l1

i3

MUX

MIN l V2

i1

MUX 1

0

0 i 3,i 2,i 1

MUX

i 3,i 2,i 1

l3

MUX

i 3,i 2,i 1

MUX

l2

l V3

Figure 38: Detailed architecture for the level classification in the LevelDecision1 function be employed for storing the one/two strings under construction. Once a string is broken, the content of the FIFO queue is stored in the memory. In the following we will focus the presentation on the management of the auxiliary memories where the addresses of the consecutive sections that constitute a string are stored. Although these memories are included in the memory unit (section 7.2) we have considered their control as part of the ordering strip unit. As we pointed out before, the objective of each auxiliary memory is the storage, in consecutive words, the addresses of consecutive strings sections of level .

C

C

In order to clarify the presentation we will consider the auxiliary memories evolution during the computation of the second strip of triangles of our example (see original mesh in Figure 20 and tessellated mesh in Figure 27). This evolution is indicated in Figure 39. In the Figure 39(a) the map of addresses after computing the first strip of triangles is indicated. This way, the first string of ) that is vertices, string 0, consists of an unique string section, with one element (mask stored in the address of the memory. In the same way the string 1 consists also of a string section meanwhile the string 2 has not been fully computed. This is indicated in the memory through the reservation of some memory words, marked in the figure with a “X”, for storing the strings sections not already computed.

9        



Each time a strip of triangles is computed the levels of the lower limit of the strip (including the possible generated midpoints) have to be stored in order to process the next string of triangles. This  , that where computed during the processing of the first way, the levels of vertices  strip of triangles, have to be stored in order to compute the second strip of triangles 2 . The structure

 I. I3 I. JI9K9K9K

2

Note that only the levels of vertices with connectivity with the second strip have to be listed. This way, for the example of Figure 10 the vertices to be considered for the second strip would be     as nodes  ,  and  are interior to the



38

MAP OF ADDRESSES String 0 Mask Address

String 2

1000000000 0000

0110000000 0000

String 1

0001110000 0000

1111111110 0010

1111111000 0001

String 3

String 4

String 5

String 6

(a) 2

61 11

3

60

3

12

4

3

4

4

3 63

64

2

1

2 3

4

13

65 14

4

3

67 68

2

50

2

5

1

6

2

7

2

2

53

8

2

55

2

9

2

2

58

10

2

3

15

2

(b) MAP OF ADDRESSES String 0 Mask Address

String 2

String 3

1000000000 0000

0110000000 0000

1111110000 0100

String 1

0001110000 0000

1111111110 0010

1111111000 0001

String 4

String 5

1111000000 0011

String 6

(c)

Figure 39: Example of auxiliary memories evolution (a) Initial map (b) Subdivision step (c) Actual map of an incomplete auxiliary memory can be easily understood through the analysis of the levels of this lower string of vertices. The string of vertices of our example, with their corresponding levels, is depicted in the first row of data of the Figure 39(b). Through the analysis of this sequence of vertices the third auxiliary memory of the Firgure 39(a) (where the string 2 is processed) can be carried out. The succession of levels in the string is basically a level 2 (from vertex ), which translates to the first address in the memory, a level 1 (from vertex ), which means that the level 2 was not still reached. Then, a memory word reservation has to be performed to store the future sets of vertices of level 2 " are of level 2 which that will be generated from this vertex of the level 1. The new vertices  translates to the following address in the memory and so on.



 I. JI. In the Figure 39(b) the detailed subdivision of triangles with root vertex  are indicated. Specif-

ically, the level of each vertex is indicated with a number and, the vertices with the same level are surrounded by a discontinuous line. To clarify the auxiliary memories updating process we will present the memories data distribution for this computing stage indicated in the figure, that is, all triangles with root vertex have been processed and the next root vertex to be processed is vertex .



first strip of triangles

39

The corresponding data distribution is indicated in the Figure 39(c). The arrows indicates the position of the memory actually under processing. In the following we detail de management of each auxiliary memory: String 0 and 1. As booth strings have been previously computed no operation has to be performed. String 2. In this memory two “X” values indicates that there were two sets of vertices (in the upper limit of the strip) that has a level lower than 2. As soon as this vertices are processed, the corresponding “X” values have to be coherently updated. As we pointed out the first X of the memory is related with the vertex (with level 1). In the current processing stage vertex is not fully computed so no changes can be performed in this memory.

 I JI J I  I  JI  

String 3. As we can observe a string section of vertices with level 3 are generated from the root vertex : . These values can be stored in the memories and the corresponding address in the first word of the auxiliary memory. On the other hand the actual lower limit string of vertices (under construction) will be employed later on to identify non processed with a 2 level have string sections. In this way we can observe that at this moment a vertex been computed. As the level 3 was not reached in this section of the mesh this is indicated with an “X” in the second position of the auxiliary memory.



 I   I  I A I 

String 4. As we can observe a string section of vertices with level 4 are generated: . The corresponding address has to be stored in the auxiliary memory in the second position. A “X” value is assigned to the first position showing in this way that the first two vertices ( ) of the lower limit string of vertices (under construction) have a level 3. In the same way, we two other “X” (third and fourth position in the memory) reflects the fact that two different sequences of levels (lower than 4) appear in the lower limit of vertices: vertex with level 3 and vertex with level 2.





Strings 5, 6, ... As these levels were not reached the corresponding auxiliary memories are still empty. The auxiliary memory management imply mainly the development of memories control and utilization of two sets of memories. This is due to the fact that an unknown information is reflected as an “X” assuming that only one string of vertices will be generated. This is not necessary true and, this way, the reserved word could be not enough for storing the information, that is, one “X” word could generate more than one address of information. The management of the memory could be carried out if two sets of auxiliary memories are employed. This way once the processing of a new strip of triangles is started, the successive words of each memory are copied to the other until an “X” is detected. Once the corresponding root vertices have been processed the updated information corresponding to the original “X” can be stored. After this the following addresses can be copied in the next positions of the auxiliary memory. This way the auxiliary memory stores the successive addresses to construct the string of vertices in successive positions of the memory.

7.5 Scheduling Example In order to complete the presentation we develop in greater detail the memory unit evolution during the mesh tessellation process. In order to do this let us considerer again the tessellated mesh of Figure 27. The initial information stored in the memory unit before the tessellation process was presented in Figure 33 meanwhile the updated information after the tessellation is presented in Figure 40. 40

MAP OF ADDRESSES String 0 Mask Address 1000000000 0000 String 1 1111111110 0010

String 2 0110000000 1110000000 0000100000 0001100000 0001110000 1111000000 1111111000 . . .

String 3 0000 0101 1001 0101 0000 0110 0001

1111110000 1111100000 0000010000 0000001100 0000001000 0111000000 1111110000 . . .

String 4 0100 1010 0101 1010 0101 1011 0111

0000000100 1111000000 1111000000 0000010000 0000100000 1000000000 0000110000 0000011000 . . .

String 5 0110 0011 1001 1010 0110 1011 1011 0110

1111111100 1000 . . . String 6 0000001110 0111 . . .

MEMORY OF DATA 0000

1

59

2

4

50

5

0001

7

53

8

55

9

58

10

6

51

54

0010

47

3

48

49

0011

12

64

13

14

56

0100

11

60

61

63

65

68

0101

67

15

16

90

17

18

20

0110

19

72

21

73

22

24

78 25

0111

75

74

76

23

77

79

27

82

1000

46

80

26

81

83

84

29

30

1001

85

31

88

32

89

1010

86

87

33

34

35

36

37

38

1011

39

40

41

42

43

44

57

28

Figure 40: Data storage of a tessellated mesh As was previously indicated the output of the ordering strip unit is made by sections of different strings that should be stored as soon as a breaking in a string is detected (or when the number of vertices in a section of a string under construction is equal to the available memory word size). This way, in Figure 40 the different sections of strings stored in the memory of data are indicated with dashed boxes. Accordingly to this storage, the map of addresses memories are coherently updated in such a way that each string of vertices can be reconstructed by reading the consecutive addresses (of the memory of data) indicated in the addresses memory . The same reconstruction operation can be performed over the memories of children and sibling in order to obtain the Child and Sibling lists.

C

C

As an example let us reconstruct the string 3 corresponding to the tessellated mesh. In order to do this the seven addresses indicated in the corresponding memory (labeled with string 3) have to be accessed. The stored information corresponding to the consecutive addresses is:

   II.I J II.J I I.  II. J JII  JI  I.  I  JJ II3I (L I3I    II. I   I 

(7)

which corresponds to the information indicated in the fourth row (string 3) of the Vertex list of Figure 27. As can be observed in the memory unit example (Figure 40), the new strings of vertices are stored in consecutive words of the memory. In this way if the last word accessed for a storage 41

operation is partially full of information, the new string is stored in the empty part of the word if there is enough space. In other case the information is stored in the following consecutive address. Obviously, alternative schemes can be proposed in order to improve the storage management in such a way that free cells of previous words can be employed later on.

8 Conclusions In this paper we have presented an architecture for adaptive subdivision of triangular meshes employing not only the local information of each triangle, but also the neighbours information. This system can be attached to a graphics pipeline to enable the rendering displacement maps in hardware. Our proposal is based on the processing of small groups of triangles that are adaptive subdivided in a recursive way. As better subdivision results are obtained for interior triangles, the grouping process we propose minimizes the number of exterior triangles and, on the other hand, it insures a good covering of the full mesh. In order to minimize the communication requirements and to optimize the unit data management an alternative way of specifying the mesh connectivity was presented. Following this strategy the data is stored in such a way that all the neighbours information required for computing each edge subdivision is available without requiring waiting clock cycles. This is due to the fact that the data is stored and processed in such a way that the temporal and spatial locality is exploited. The data management is carried out through the utilization of a simple control and the resulting architecture is mainly made of the storage memories, FIFO queues and the butterfly processor. The number of multipliers of the butterfly processor can be selected in function of the available area as the implemented design is not conditioned by it.

Acknowledgements This work was partially developed during the stay of Dr. M. Amor and Dr. M. B´oo in the WSI/GRIS Department, Universtiy of T¨ubingen (GERMANY), and partially supported by “Secretar´ıa Xeral de Investigaci´on e Desenvolvemento”, Xunta de Galicia (SPAIN).

References [1] M. F. Deering, Geometry Compression, Proceedings of SIGGRAPH 95, Computer Graphics Proceedings, Annual Conference Series, pp. 13-20, 1995. [2] S. Gumhold, W. Stra er, Real Time Compression of Triangle Mesh Connectivity, Proceedings of SIGGRAPH 98, Computer Graphics Proceedings, Annual Conference Series, pp. 133-140, 1998. [3] J. Rossignac, Edgebreaker: Connectivity Compression for Triangle Meshes, IEEE Transactions on Visualization and Computer Graphics , vol. 5, no. 1, pp. 47-61, 1999. [4] D. King, J. Rossignac, Guaranteed 3.67V bit encoding of planar triangle graphs, 11th Canadian Conference on Computational Geometry (CCCG’99), pp. 146-149, 1999. [5] J. Cohen, M. Olano, D. Manocha, Appearance-Preserving Simplification, Proceedings of SIGGRAPH 98, Computer Graphics Proceedings, Annual Conference Series, pp. 115-122, 1998. [6] L. Kobbelt, S. Campagna, H-P Seidel, A General Framework for Mesh Decimation, Graphics Interface ’98, pp. 43-50, 1998. 42

[7] H. Hoppe, Progressive Meshes, Proceedings of SIGGRAPH 96, Computer Graphics Proceedings, Annual Conference Series, pp. 99-108, 1996. [8] D. Zorin, P. Schr¨oder, W. Sweldens, Interactive Multiresolution Mesh Editing, Proceedings of SIGGRAPH 97, Computer Graphics Proceedings, Annual Conference Series, pp. 259-268, 1997. [9] L. Kobbelt, S. Campagna, J. Vorsatz, H-P Seidel, Interactive Multi-Resolution Modeling on Arbitrary Meshes, Proceedings of SIGGRAPH 98, Computer Graphics Proceedings, Annual Conference Series, pp. 105-114, 1998. [10] I. Guskov, K. Vidim  e, W. Sweldens, P. Schr¨oder, Normal Meshes, Proceedings of SIGGRAPH 2000, Computer Graphics Proceedings, Annual Conference Series, pp. 95-102, 2000. [11] M. Eck, T. DeRose, T. Duchamp, H. Hoppe, M. Lounsbery, W. Stuetzle, Multiresolution Analysis of Arbitrary Meshes, Proceedings of SIGGRAPH 95, Computer Graphics Proceedings, Annual Conference Series, pp. 173-182, 1995. [12] I. Guskov, W. Sweldens, P. Schr¨oder, Multiresolution Signal Processing for Meshes, Proceedings of SIGGRAPH 99, Computer Graphics Proceedings, Annual Conference Series, pp. 325334, 1999. [13] R.L. Cook, Shade Trees. Computer Graphics (Proceedings of SIGGRAPH 84), vol. 18, no. 3, pp. 223-231,1984. [14] A. Witkin, M. Kass, Reaction-Diffusion Textures, Computer Graphics (Proceedings of SIGGRAPH 91), vol. 25, no. 4, pp. 299-308, 1991. [15] K. Miyata, A Method of Generating Stone Wall Patterns, Computer Graphics (Proceedings of SIGGRAPH 90), vol. 24, no. 4, pp. 387-394, 1990. [16] V. Krishnamurthy, M. Levoy, Fitting Smooth Surfaces to Dense Polygon Meshes, Proceedings of SIGGRAPH 96, Computer Graphics Proceedings, Annual Conference Series, pp. 313-324, 1996. [17] M. Doggett, J. Hirche, Adaptive View Dependent Tessellation of Displacement Maps, SIGGRAPH/Eurographics Hardware Workshop, pp. 59-66, 2000. [18] J. Warren, Subdivision Methods for Geometric Design, Unpublished Manuscript, Dept. Computer Science, Rice University, 1995. [19] P. Schr¨oder, D. Zorin (Organizers), Subdivision for Modeling and Animation, SIGGRAPH 98 Course Notes. [20] H. Prautzsch, G. Umlauf, Improved Triangular Subdivision Schemes, Computer Graphics International 1998, pp. 626-632, 1998. [21] A. Lee, H. Moreton, H. Hoppe, Displaced Subdivision Surfaces, Proceedings of SIGGRAPH 2000, Computer Graphics Proceedings, Annual Conference Series, pp. 85-94, 2000. [22] S. Bischoff, L.P. Kobbelt, H-P. Seidel, Towards Hardware Implementation of Loop Subdivision, SIGGRAPH/Eurographics Hardware Workshop, pp. 41-50, 2000. [23] C. Loop, Smooth Subdivision Surfaces Based on Triangles, Master’s thesis. University of Utah, Department of Mathematics, 1987. [24] D. Zorin, P. Schr¨oder, W. Sweldens, Interpolating Subdivision for Meshes with Arbitrary Topology, Computer Graphics Proceedings (SIGGRAPH 96), pp. 189-192, 1996. 43

[25] D. Zorin, Subdivision and Multiresolution Surface Representations, PhD thesis, University of Caltech, Pasadena, 1997. [26] L. Kobbelt, Interpolatory Subdivision on Open Quadrilateral Nets with Arbitrary Topology, Computer Graphics Forum, vol. 15, no. 3, pp. 409-420, 1996. [27] H. Qin, C. Mandal, B.C. Vemuri, Dynamic Catmull-Clark Subdivision Surfaces, IEEE Trans. on Visualization and Computer graphics, vol. 4, no. 3, pp 215-229, 1998. [28] J. Stam, Exact Evaluation of Catmull-Clark Subdivision Surfaces at Arbitrary Parameter Values, Proceedings of SIGGRAPH 98, Computer Graphics Proceedings, Annual Conference Series, pp. 395-404, 1998. [29] N. Dyn, D. Levin, J.A. Gregory, A Butterfly Subdivision Scheme for Surface Interpolation with Tension Control, ACM Trans. on Graphics, vol. 9, no. 2, pp. 160-169, 1990. [30] K. Pulli, M. Segal, Fast Rendering of Subdivision Surfaces, Eurographics Rendering Workshop 1996, pp. 61-70, 1996 [31] F. Evans, S. Skiena, A. Varshney, Optimizing Triangle Strips for Fast Rendering, IEEE Visualization Proc., pp. 319-326, 1996.

44

V1

V5

V1

V1

V5

V1

V5

V5

2 2

1 V3

V2

V2

0000

V3

V2

V2

V3

0001

1

0010

V3 0011

i4 i3 i2 i1 V1

V5

V1

V5

V1

V5

V5

V1

2 2

1 V2

3

V2

V3

0100

V1

3

3

V2

V3

0101

V5

V5

V1

2 4

4 V2

V3

V2

1000

V1

4

1 V3

1010

V5

V1

V5

V1

V2 3

V2

V3 1100

3

3

V2

V3

V1

V5 4

4

1

4

1101

V3 1011

2 4

V3

1110

V5 1

2 3

V2

V3

1111

+

Figure 41: LevelDecision2: Possible triangle partitioning and data encoding ( vertex

A

1

V2

V3

1001

V5 2

4 V2

V3

0111

V5

V1

3

V2

V3

0110

V1

1

C + I C " I C  I C  ) without

Appendix. LevelDecision2 Function

    "  "

+

The possible partitioning situations are detailed in Figures 41 and 42. Specifically, in Figure 41 all the situations with a non subdivided edge are indicated meanwhile in Figure 42 the midpoint is considered. Each situation is characterized by the values of the decisions corresponding to edges , , and , respectively. The possible new vertices are labeled , , and respectively.

 

C+ IC" IC IC

"





"

+C C " C   C 

The available information to classify the levels of vertex and the possible vertices , and     is those corresponding to the levels of ( ), (  ) and the decision values , , , . Furthermore, if the midpoint exists then the level of (   ) is considered. The operations to be performed in this level decision are detailed in Tables 2 and 3. The , , , values indicate the row of the table to be employed for the computations of vertex 3 ( ), vertex 2 (  ), vertex 1 (  ) and vertex (  ).

+

"

+

"

C+ C" C C



A specific treatment was performed over some nodes. Specifically, in the cases

45



C + C " C  C  = 0010,

V1

V4

V5

V5

V4

V1

V4

V1

V2

V3

V3

0000

V4

V1

2

1 V2

V5

2

V2

V3

0001

V5 1

V2

0010

V3 0011

i4 i3 i2 i1 V1

V4

V5

V4

V1

V5

V4

V1

3

3

V2

V3

0100

V1

V4

V3

4

V5

4 V2

V3

V2

V1

V4

4

V2

V5

3

V2

V3 1100

V3

V5

V4

4 3

1101

1 V3

V1

2 V2

V5

1011

V4

4

V3

2 V2

V3

V1 1

4 V2 3

V4

V1

1010

V4

V1

V5 4

1001

V5

3

V2

4

V3

1

0111

V4

V1 1

1000

V3

0110

V4

V1

V5

2 3

V2

0101

V5

V4

V1

2

1 V2

V5

V3

V5 1

2 3

V2

1110

V3

1111

C + I C " I C  I C  ) with vertex + + and the cases 0010 and 0011 with the midpoint + a irregularities

Figure 42: Possible triangle partitioning and data encoding (

0011, 1011 without the midpoint connectivity between no consecutive strings can appear (see the example of Figure 10). In order to avoid irregularities connectivity a level reassignation have to be performed, the function employed in these tables to solve this problem is defined us:



C I H I I ,I  





 

C C C  H H C H  C 

C















OR  OR OR 

H



C





(8)

otherwise

C + C " C  C   9   JI 9 9 C+C"CC 

Following the above method, some irregularities can appear in the connectivity of the strings. Specifically, in the cases a connectivity between non consecutive strings can appear. As an example, in Figure 43(a) ( ), a level is assigned to vertex because of its connectivity with vertex with level . As a consequence, a connectivity between non-consecutive levels appear: vertex with level and vertex with level . In order to keep the regular structure a level reassignation have to be performed. This way, in Figure 43(b) a level is 46





9  

"





"



.

assigned to the vertex

+

In the same way, in the LevelDecision2 function the children connectivity is also computed. In this case the tables to be applied are Tables 4 and 5 without the midpoint and Tables 6 and 7 with . Specifically, each partitioning situation is characterized by the values of the decisions , , , which are employed as inputs of these tables. In these tables the number of children of the vertices 4 ( ), 3 ( ), 2 (  ), 1 ( ), (  ), (   ), (  ), (   ) and (  ). The functions employed in these tables are defined us:

+

+

"





+



"

CIH  CIH  



% HH CC  % HH  CC 

C+ C" C C



CC HH CC HH

(9)

+

"





On the other hand, Tables 8, 9 and 10 have to be employed to compute the sibling connectivity. In this case the sibling connectivity to be computed is this related with 4 ( # ), 3 ( # ), 2 ( # ), 1 ( # ), ( #   ), ( #  ), ( #   ) and ( #  ). The vertex is not analyzed (information about the right neighbour is not still available). The functions to be employed are in this case:

+

"





CC  CC   HH CC  # CC CC  # CC (10)   CC  CC   HH C C H  # '  CC  C  H OR  otherwise this way, with the h(i,j) equation the sibling connectivity list of vertex H is updated, if this is the case, G  C I H  ## ' '  # ' G   C I H I  G#   H I

G   C I H I   G#   H I

G "  C I H   ## ''  # '  # ' '  # '' # # C IH I  #'  









 









through the inclusion of a new value in the list. For the z(i,j,k) equation the sibling connectivity of the vertex  is updated, if this is the case, can be through the inclusion of two new connectivity values.

47

 

)+1

 

 



  

)+1 +1)+1 )+1

 



)+2 )+1







 

, ,

 



 

)+2 )+1





 

, ,

: Level classification



,



 

,











,







,









,









,













 

,

, , ,



 



min( )+1 min( min( )+1 +1 )+1 min( min( )+1 +1 +1 )+1 min( min( )+1 +1 )+1 min(



 

,

,



)+1





,



  

 

 

 

 

 

Table 2: LevelDecision2 without the midpoint





)+1







  





  

, )







 

 

 



 















 





+1, +1,

)+1 , , ,





   

min( , min( ,

min(



 

 



   











0 0 0 0



)+1







0 0 min( , +1 0 0 min( , +1; In( 0 0 +1)+1 min( , +1)+1 +1 

      

+1 +1 +1 +1

0 min( , ) 0 min( 0 min( 0 min( 0 min( 0 min( 0 min( 0 min(

  



    



 

 

, )+1; In( , , , ; In( , , , , )









0 0 min(

 



0 0 0 0



0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1



 

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

 



0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

 







48

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

)+2



: Level classification

 

 

 

































 

 

 

 

 

 

 

 

  

 

 

 







)+1





 

,





 

 

)+1



,









)+1





 

,



 



 

   

 

)+1



,









)+1

, )+1 +1, +1)+1 , )+1 )+1 )+1 , )+2 , )+1 )+1 , )+1 +1, +1)+1 , )+1 )+1 )+1 , )+2





)+1

 

 

,

)+1

, , , , , , , , , , , , , ,



 

,

,





,

min( , , ) min( min( min( min( min( min( min( min( min( min( min( min( min(

    



,





)+1; In(



 

  



Table 3: LevelDecision2 with the midpoint

,

,

)+1



 





,



)+1 )+1

 

 





, ,

,



)+1 )+1







, ,







)+1 )+1



min(



0 min( , ) 0 min( 0 min( 0 min( 0 min( 0 min( 0 min( 0 min(

 

 



,





,





,



 



)+1; In( )+1

 



, ,



 

 

 

 

 



 



 



+1, +1,





+1, +1,



















min( , min( ,



 

  

+1)+1

,

, ,



  



       

+1 +1 +1 +1

0 0 0 0 min( 

0 0 min( min( 0 0 min( min( 0 0 min( min( 0 0 +1)+1 min( +1)+1 min(

 



0 0 0 0



0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1



0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

 

 

0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

 

 





49

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1







 

 

 

 





 



  

 

  

  





: Children classification for the vertices , ,







  

 

 



  

  

  

 

 

  

  



  

  

0 f( , ) , ) 0 f( , )+f( , ) 0 f( , ) , ) 0 f( , )+f( , ) 0 f( , ) , ) 0 f( , )+f( , ) 0 f( , ) , )+f( , ) 0 , ) f( , )

       

   





       

Table 4: LevelDecision2 without the midpoint

       

) ) )+f( )+f(

 

               

, , , ,

 





, )



 



       

         

0 0 f( , )+f( f( , ) 0 0 f( , )+f( f( , ) 0 0 f( , )+f( f( , ) 0 0 , ) f( , )+f( , ) f( , )+f(

   

0 0 0 0 0 0 0 f( , ) 0 , ) 0 , )+f( , ) 0 , )+f( , ) 0 , ) f( , ) f( , )+f( , ) f( , )+f( , ) f( 

0 0 0 0 0 0 0 0 f( f( f( f( f( f( f( f(



0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1



0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

       

0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

                                  









 

50

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

and

 



  

, , ,

,





 



 













) ) )+f( , ) , ) , ) , ) , ) , ) , ) , )+f( , , ) 



) ) )

)

Table 5: LevelDecision2 without the midpoint 













 









) f( f( , ) f( f( f( f( , ) f( f( , ) f( f( f( , ) f( , ) f( f( , ) f( , ) f(



,



                                                                                



 

f( 0 f( 0 0 0 ) f( 0 f( 0 0 f( f( 0 ) f( f(        



                                                    

,

, , , ,

, , , ,

, , , ,

) ) ) )

       

, , , ,

) ) )+f( , )+f( ,

) ) ) )

) ) ) )

                                                       

       

I( f( ) I( ) f( I( f( I( f( I( I( I( I( I( f( I( f(

, , ,

,

, , ,

,

, ,

, ,

, , ,

,

: Children classification for the vertices

, , and 



, , ,

 



 

I( I( f( I( I( I( f( I( I( I( f( I( I( I( I( I(

 

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

 

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 







 

) ) ) )+I( , ) )+1 )+1 )+1 )+1 ) )+f( , ) ) ) )+1 )+1 ) )

 

















0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

 

51 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1





   

  

 

  



 

 



  



   



: Children classification for the vertices , ,





 

 

 

  

  

 



 

  

 



  

, )

  

 

 

 

 

       

  

, )+f( , )+f(

    

     



 

Table 6: LevelDecision2 with the midpoint

 

       

     

 

, )+f( , )+f(





       

     

, )+f( , )+f(

  

)+f( ) )+f( )+f(

         

                   



, , , ,

0 f( , )+f( , )+f( , ) 0 , )+f( , ) f( , ) 0 f( , ) , ) 0 , )+f( , ) f( , )+f( , ) 0 f( , ) , ) 0 , )+f( , ) f( , )+f( , ) 0 f( , ) , )+f( , ) 0 , )+f( , ) f( , )+f( , )

         



, )+f( , )+f(

 



   



   





, )+f(



 

       



0 0 f( f( 0 0 f( , ) f( 0 0 f( f( , ) 0 0 , ) f( , ) f(



0 0 0 0 0 0 0 f( , ) 0 , ) 0 , )+f( , ) 0 , )+f( , ) 0 , ) f( , ) f( , )+f( , ) f( , )+f( , ) f( 

0 0 0 0 0 0 0 0 f( f( f( f( f( f( f( f(



0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1

       

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1





0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

                               





 

52

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

and

,

, 



 



  

 

 





  

 

 



  

 

 



  

 



 



 



 



,

,

 



 



 



       

       



,

,





 

,









       









 

,





 

, , , 

, , ,



, , ,

 

)+f( )+f( ) )+f( )+f( )+f( ) )+f( )+f( )+f( ) )+f( )+f( )+f(

,  



 



,





  

 

,



 



  

)



 



  

,

 



  

,

 



 

,

) )

, ,

, ,

, ,

)

)

) )

) ) )

)

) )

, , ,

, , ,

Table 7: LevelDecision2 with the midpoint )+f( )+f( )+f(

) )+f( )

  



,



,

 

) )+f(

)

)





 



)+f(



 

, ,

 



)+f(





,

 

       

,



                                

f( 0 f( 0 0 f( f( 0 f( f( f( f( f( f( f( f( 













 











,

 

           





)+f( )

















                                                                                



f( f( , ) f( f( f( f( , ) f( f( f( f( , )+f( , )+f( , ) f( , )+f( , )+f( , ) f( , )+f( , ) f( f( , ) f( f(

,

, , , ,

, , , ,

, , , ,

       

, , , ,

) ) )+f( , )+f( ,

) ) ) )

) ) ) )

) ) ) )

: Children classification for the vertices

, ,

                                                             

        

I( f( ) I( ) I( I( I( I( I( I( I( I( I( I( I( I( f(

, ,

, ,

, ,

, ,

, ,

, ,

and

)+1 )+1 )+1 )+f( , ) ) ) ) ) )+f( , ) )+1 ) )









 

,

 

, , ,



, 



,

) f( f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f( ) f(

 

, ,

)

 

,

,



,  



  

,

,





,

 



  

,

,





,

 



  

,







I( I( I( I( I( I( I( I( I( I( I( I( I( I( I( I(  













0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1  









0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1  

53 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ) ) )

)

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1                             

 







           



0 0 0 0 0 0 0 0 h( h( z( z( h( h( h( h(                    







  

















  



        





0 0 0 0 h( 1 z( z( , ) 0 , ) 0 , , ) 0 , , ) 0 , ) h( , ) h( , )+h( , ) z( , ) z( , )

, ,

, ) , )

, ) , ) , , ) , , ) 

Table 8: LevelDecision2 without the midpoint   



        

    

 



  

  



   

  



  





  

 

 

  



  





  





,

,





0 0 0 h( h( , )+z( , , ) 0 z( , , )+1 h( 0 0 0 h( 1 0 h( , )+h( , ) h( 0 0 0 h( h( , )+h( , ) 0 1 h( 0 0 0 h( h( , )+h( , ) 0 h( , )+h( , ) h( ,

,

,

,

,

,

 









,



, , ) , ) , ) 

 

 

, 

    





                        

 

h( ) h( z( ) z( h( ) h( 0 ) 0 h( ) h( 0 ) z( h( ) h( 0 ) 0  

,

,

) ) , , ) , , ) , ) , )

)

)

h( h( z( z( h( h( h( h( h( h( h( h( h( h( h( h(

: Sibling classification

                                                                                   

, ,

, , , , , ,

, , , ,

, , , ,

h( h( , ) h( , ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h( ) h(

) )

                                                        

  































0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1  

54 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 , , ,

,

, , ,

) ) )

, , ,

,

, , ,

,

,

) ) )

)

) ) )

)

) ) )

)

)



0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1





 

 

,

, )









0 h ( , , ) 0 h( 0 h( 0 , )+z( , , ) h( 0 h( , )+h ( , , ) 0 h( 0 h( 0 h(

  



  

 

  



, )

  



, )

  

, )





     

 

 

, )

  





  



, )

  

, )





, ) 

: Sibling classification for the vertices , ,





  





 





         

0 0 z( 1 0 0 1 h( 0 0 h( 1 0 0 1 1



Table 9: LevelDecision2 with the midpoint

 

                  







 



 







 



 

, ) , ) , , ) , , ) , ) , ) , )+h( , )+h(

  

                   

0 0 0 0 h( , ) h( , ) z( , , ) z( , , )+h( , ) 0 0 0 0 h( , ) h( , ) , ) h ( , , )+h( , ) , ) h( , )+h ( , , ) 

                              

0 0 0 0 0 0 0 0 h( h( z( z( h( h( h( h(













55

0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1

and

Table 10: LevelDecision2 with the midpoint 





 









 





 



  





 



























 









 







  

 





 











             

 

                                                                         





 





 

  















 

 









 



















 



 

 

 

,

: Sibling classification for the vertices





                       

 

 



,

              

 





, ,

,

, , ) , ) , ) , ) , ) , ) , )+h( , , ) , ) , ) and





 

) )+h( ,



, ,



, ,

 

               

  



                                                                               

h( h( h( h( h( h( z( h( h( h( h( h( h( h( h( h(  







 

)+h(

h ( , ) h( , ) z( , , ) z( , , ) h( , ) h( , ) h( , ) h( , ) h( , ) h( , ) ) h( , ) h( , ) h( , ) h( , ) h( , ) h( , )  



    



h ( , , ) h( , ) z( , , )+h( , ) z( , , ) h ( , , ) h( , )+h( , ) h( , ) h( , ) h ( , , )+h( , ) h( , )+h( , ) h ( , , )+h ( , , ) h ( , , )+h( , ) h( , )+h ( , , ) h ( , , )+h( , ) h( , ) h( , )  





 

h ( , , ) h ( , , ) h ( , , ) h( , ) h ( , , ) h( , ) h( , ) h( , ) h ( , , ) h( , ) h ( , , ) h( , )+h( , h( , ) h ( , , ) h( , ) h( , )

 

 

















0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 

0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 







0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1

 

56 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 ) )

)

) )

)

4

3

4

4

V5

V1

3

V1

5

V5

5

4

6

4

5

V3

V2

4

V3

V2

(a)

(b)

Figure 43: Example of level reassignation

C" C C " 0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1







0 0 0 0

0 0

  





 



)+1 

0 0



 









min( , 







min(      



 ,

)+1



Table 11: LevelDecision1: Level classification

B Appendix. LevelDecision1 Function

C" IC IC

 "  "

The possible partitioning situations for a generic case are detailed in Figure 44. Each situation is characterized by the values of the decisions corresponding to edges , and , respectively. The possible new vertices are labeled , and respectively. The available information to classify the levels of vertex and the possible vertices and is those corresponding     to the levels of ( ), (  ), the possible vertex ( ) and the decision values .

 





"









C" IC IC

C" IC IC

The operations to be performed in this level decision are detailed in table 11. The values indicates the row of the table to be employed for the computations of the level of vertex 3 ( ), vertex 2 ( ) and (  ). As an example let us consider the case which is indicated in the last row of the table. In this case, as it is indicated in Figure 44 all the three edges are directly computed from the level are partitioned. On the other hand the levels of node and of node meanwhile the node requires a minimum selection operation between two possible level values.

"

"







"



C" IC IC



In the same way, in the LevelDecision1 function the children connectivity is also computed. In this case the table to be applied is table 12. Specifically, each partitioning situation is characterized by the values of the decisions which are employed as inputs of the table 12. In this table the number of children of the vertices ( ), ( ), ( ), (   ) and (  ) are computed. For example let us consider the , and cases outlined in Figure 44. In all these cases the number of children assigned to the vertex is increased in an unit. On the other hand the number of children of vertex do not require to be computed until the next child of the root vertex is processed (vertex will be, in the usual case, vertex of the next triangle).

"

"

C" IC IC "     9  9  9 



" 





On the other hand table 13 has to be employed to compute the sibling connectivity. In this case the sibling connectivity to be computed is this related with vertices ( # ), ( # ) and ( #   ). The vertex is not analyzed (information about the right neighbour is not still available) and a zero sibling 57

V1

V1

V1

V1 2

1 V3

V2

V2

V3

000

V2

V3

001

2

1 V2

V3

010

011

i3 i2 i1 V1

V1

V1

V1 2

2

1 3

V2

1 3

V2

V3

100

V3

3

V2

101

V3

3

V2

110

V3

111

Figure 44: LevelDecision1: Possible triangle partitioning and data encoding (

C" C C " 

0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1









0 0 0 0 0 0 f(  f(   

0 0 f(  , ) f(  , ) 0 0 , ) f(  , ) , ) f(  , )+1

""

"" 





 



 

0 f(  ,    f( , ) f(  , 0 f( ,  f(  , )+f( , ) f(  , 0 f( ,  f( , ) f( ,  0 f( ,   f( , 

" 





 

"" ""



C" IC IC)

)

 

 

   

) )+1 ) ) ) ) )

     



         



Table 12: LevelDecision1: Children classification

connectivity is assigned to vertex

C

 (#    ).

Appendix. LevelDecision3 Function

Some possible partitioning situations are detailed in Figure 45 (notation explained in Figure 23(b)). Each situation is characterized by the values of decisions stored in table2. The possible new vertex to edge  - is labeled 5. The computation of the levels, children connectivity and sibling connectivity is similar to LevelDecision2 and LevelDecision1. After the information of the vertices , 1 and

"

C" C C # " #  0 0 0 0 1 1 1 1

0 0 1 1 0 0 1 1

0 1 0 1 0 1 0 1

0 0 0 0 1 1 1 1



0 h(  , ) 0 1 0 1 0 h( , )

 

# 



h(  ,  h(  ,  h( , 



" "

1 h( , h( , 1 h( ,

) 

)

)

) 

"

 )+ h( ,   ) 



)

Table 13: LevelDecision1: Sibling classification

58

V1

V5

V1

V6

V5

V1

V6

V5

1

V3

V2

V2

1

V3

V2

5

V3

Table2

Suggest Documents