CPU-GPU Algorithms for Triangular Surface Mesh Simplification
CPU-GPU Algorithms for Triangular Surface Mesh Simplification
CPU-GPU Algorithms for Triangular Surface Mesh Simplification
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
6 Suzanne M. Shontz and Dragos M. Nistoroperation, the algorithm terminates. This also ensures that the edge-collapseoperation is per<strong>for</strong>med uni<strong>for</strong>mly and exhaustively across all elements assignedto the <strong>GPU</strong>, and that no one area is more or less simplified or de<strong>for</strong>med. Thepseudocode <strong>for</strong> the naïve <strong>GPU</strong> marking simplification algorithm is given inAlgorithm 2.Algorithm 2 The <strong>GPU</strong> Marking <strong>Simplification</strong> Algorithmfunction <strong>GPU</strong>-Mark(mark, elements, vertices)<strong>for</strong> all T ∈ N(mark) do <strong>GPU</strong> thread T : mark-as-affected(T )end <strong>for</strong>end functionfunction <strong>GPU</strong>-Mark-Simplify(elements, vertices)<strong>for</strong> all T = (v 1, v 2, v 3) ∈ elements doif not marked(T ) thencollapse((v 1, v 2))mark-as-collapsed((v 1, v 2))<strong>GPU</strong>-Mark(T )end ifend <strong>for</strong>end function2.3 <strong>GPU</strong> Inverse Reduction AlgorithmWe propose a <strong>GPU</strong> mesh simplification algorithm that leverages the fullstrength of the <strong>GPU</strong>. Unlike our previous algorithms in which one elementwas examined at each iteration of the main loop to determine which elementswere not affected, we now examine twice as many elements per iteration, witheach element examined by a different <strong>GPU</strong> thread. To take full advantageof the architecture of the <strong>GPU</strong>, a soft-grained blocking [21] method based ontest-and-set [1] is used to decide if any edge of an element should be collapsed.We attempt to lock each vertex in an element by calling test-and-set on theaffected bit of each vertex in the element. Pseudocode <strong>for</strong> the <strong>GPU</strong> inversereduction simplification algorithm is given in Algorithm 3.Correctness. The <strong>GPU</strong>-Simp-Try method attempts to lock each vertex ofan element by checking to make sure the vertex has not already been collapsed.If it finds that a vertex has already been locked, it releases all previously-lockedvertices. There<strong>for</strong>e, if a thread successfully locks v 1 , v 2 , and v 3 <strong>for</strong> element t,this means that no other thread has locked any t n ∈ N(t), either currently orpreviously. There<strong>for</strong>e, the algorithm simplifies the mesh both uni<strong>for</strong>mly andexhaustively, ensuring that no one area is too simplified or de<strong>for</strong>med.