memory-efficient sliding window progressive meshes pavlo turchyn university of jyvaskyla
TRANSCRIPT
Previous work• Progressive mesh is a data structure used to encode a large
number of mesh approximations– prog. mesh is similar to undo/redo mechanism of a text editor
– undo/redo keeps record of modifications done on text
– prog. mesh keeps record of modifications done on mesh
– by performing a certain number of modifications, one obtains the mesh with required number of triangles
• Progressive meshes are problematic for GPUs– mesh modifications must be performed on CPU
– each mesh instance requires updating its mesh data
– then the updated data has to be transferred from CPU to GPU
• Sliding window progressive mesh (SWPM) is a solution for view-independent LOD
Previous work
• Progressive mesh contains information what to do– which edge to collapse, which vertex is split
• SWPM contains triangulations– these “precomputed” triangulations can be stored in static on-GPU memory
buffers
Vertex split
Half-edge collapse
Half-edge collapse
“Simplified patch”
• Simplified patch is a patch after applying simplification operator that removes the inner vertex
• … that includes all triangles incident to a given vertex– this vertex is called inner vertex
Definitions
“Patch”
• Patch is a set of triangles
SWPM simplification algorithm
• Step 1: find the set of inner vertices– it follows from the patch definition that the inner vertices belong
to an independent set
SWPM simplification algorithm
• Step 1: find the set of inner vertices
• Step 2: construct the patches– criterion: a patch should not contain topologically isolated
triangles– all patches (denoted P1,...,P10 in our example) are stored in a list
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
P1
P2
P3
P4
P6
P5
P9
P8
P10
P7
SWPM simplification algorithm
• Step 1: find the set of inner vertices
• Step 2: construct the patches around inner vertices
• Step 3: simplify the patches to obtain “simplified patches”– all inner vertices are removed– the simplified patches (denoted Q1,..., Q10) are appended to the list of patches
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10
Q1
Q2
Q3
Q4
Q6
Q5
Q9
Q8
Q10
Q7
Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10
SWPM simplification algorithm
• This memory buffer is the main SWPM data structure
• Required number of triangles is obtained by choosing the corresponding subsequence of elements (“window”)– window size is 10 elements in our example
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10
• SWPM buffer holds triangles as triples of indices
• Such an index buffer consumes 4-6 times more memory than the index buffer of the initial mesh– often SWPM index buffer is bigger than vertex buffer of the mesh
• – C is the amount of memory for storing a single triangle
– is the number of triangles in the buffer
• In order to minimize the buffer size, we have to minimize
• Minimal is bounded
– where |T0| denotes the number of triangles in the initial mesh
SWPM index dataset size
buffer_size_in_bytes C
0 02 | | 11| |T T
• Under certain assumptions, the following estimate holds
– is the average degree (valence) of the inner vertices
– is a mesh-dependent parameter that reflects triangulation structure
Feasible triangles quality
SWPM index dataset size
0| | ( 1)T d
3d 4d 5d 6d
d
d
Mesh connectivity optimization
16% dataset reduction
• Idea: change mesh connectivity in order to reduce d
• Using this mesh as the initial one, we construct another SWPM buffer B1
Clustered patches
• This is the simplest mesh we can render from the buffer B0
– But what if we need even simpler mesh?
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10B0 :
(1)1P (1)
2P (1)3P (1)
4P (1)5P (1)
1Q (1)2Q (1)
3Q (1)4Q (1)
5QB1 :
• Then, obtain simplified patches (by deleting all inner vertices)
• Idea: construct the “clustered patches”– a clustered patch is a patch (see definition)
– a clustered patch is a union of several consecutive simplified patches
Clustered patches
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10
h1P
Q1 Q2 Q3
h2P
Q4 Q5
h3P
Q6
h4P
Q7 Q8
h5P
Q9 Q10
Q1
Q2
Q3
Q4
Q6
Q5
Q9
Q8
Q10
Q7
Q4
Q6
Q5
Q9
Q8
Q10
Q7
Q6
Q9
Q8
Q10
Q7
Q9
Q8
Q10
Q7
Q9
Q10
B0 :
B1 :h1Q h
2Q h3Q h
4Q h5Q
• –
– thus, it is sufficient to store only the last part of B1
• Consider the buffers B0 and B1
– each clustered patch represents several consequtive simplified patches, so the first part of B1 is identical to the part of B0
Clustered patches
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10B0 :
h1Q h
2Q h3Q h
4Q h5QB1 :
h1P h
2P h3P h
4P h5P
Clustering algorithm
• Input: the set of simplified patches
• Step 1: construct special vertices connectivity graph– any two vertices that belong to the same patch must be connected
with an edge
– resulting graph is not planar
Clustering algorithm
• Input: the set of simplified patches
• Step 1: construct special vertices connectivity graph
• Step 2: find the set of inner vertices– inner vertices belong to an independent set
– it is possible to use the same program code, which is used in the original SWPM simplification algorithm to find the set of inner vertices
Clustering algorithm
• Input: the set of simplified patches
• Step 1: construct special vertices connectivity graph
• Step 2: find the set of inner vertices
• Step 3: construct the clustered patches– a clustered patch must include all simplified patches indcident to its
inner vertex
h1P
h2P
h3P h
4P
h5P
Clustering algorithm
• Input: the set of simplified patches
• Step 1: construct special vertices connectivity graph
• Step 2: find the set of inner vertices
• Step 3: construct the clustered patches• Step 4: since clustered patch is a union of several consecutive simplified
patches, thus one may have to reorder the list of simplified patches
h1P
h2P
h3P h
4P
h5P
• Replace the last part of B0 with the last part of B1
– resulting buffer is also SWPM
The trade-off
P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10B0 :
h1Q h
2Q h3Q h
4Q h5QB1 :
• It is possible to trade the size of SWPM index dataset for the number of approximations stored in SWPM
h1Q h
2Q h3Q h
4Q h5QP1 P2 P3 P4 P5 P6 P7 P8 P9 P10
h1Q h
2Q h3Q h
4Q h5Q
Results• Reduction of SWPM index dataset:
– via connectivity optimization: ~20%
– via clustering: ~20%
– via optimization+clustering: ~30%
– via optimization+clustering+trade-off: >50%
• Clustering increases vertex cache miss ratio, but not significantly
0.5
0.55
0.6
0.65
0.7
0.75
0.8
0.85
0.9
0.95
1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
LOD
ACMR
venus (no clustering)
venus (clustering)
venus (NVTriStrip)