-
Merge error formulation for the simplification. This is based on a formula
derived by Gopi:
Here the merge error refers to the error in creating new vertex x by
collapsing vertices p and q. This error is what we quantify using either
our distance function (in which case it just depends on p and q) or using
the quadric error metric (where x is chosen to minimize this metric).
-
Vertex error propagation. Having the errors accumulating in the vertices
as they are created by merges is another addition to the QEM. When everything
else remains the same, just adding vertex error propagation results
in a quality of simplification that is no worse than the original QEM.
Thus it paves the way for using this formulation for the distance function
where it is essential to prevent very average looking results such as those
from the midterm report, due to some heavily merged edges being repeatedly
picked because of their length being favorable in "distance function space".
-
DF minimization. With merge error and vertex error accumulation/propagation,
we can replace the picking stage and the propagation stage with something
calculated using the distance function. For the new vertex positioning
stage, we were still using the quadric error metric to find the point with
minimum error. To incorporate distance function here, a method was required
that would place the new vertex to reduce (maybe not minimize) the distance
function value on all the edges arising from that new vertex. As a first
attempt, we have used a linear interpolation that works thus:
The effect of this is to place the new point closer to the planes of
p if the distance of q from the planes of p is less than that of p from
q's planes.
-
With the framework ready, I put all these changes as compile-time options
to Garland's Mixkit library on top of which QSlim is based. Depending on
how you compile it, the behavior of the simplification changes into one
of four supported modes:
-
Original QSlim (QEM)
-
QEM with vertex error propagation (Q/VEP)
-
Distance function with new vertex position chosen by QEM minimization (DF/VEP,
QEM for new vertex position (QNV))
-
Distance function with new vertex position chosen to reduce the distance
function error (DF all the way)
-
Optimizations. The significant one that got the run time of the DF variants
down was realizing that the order of computatation used by QSlim (to compute
the QEM for each and every edge first, and then choose the minimum cost
edge on the heap, and when collapsing that edge, use the precomputed minimum
error and the position of new vertex that minimizes this error, was an
overkill when doing a hybrid of the two methods (my second variant). It
suffices to calculate the DF value on all edges (a fast computation compared
to QEM minimization which involves a 4x4 matrix inversion) beforehand,
and to calculate the minimization (using QEM or DF minimization) only for
an edge that has been selected to merge. So the new pipeline is:
-
create all edges & place in a heap, keyed by Vertex Error (not simply
Merge Error) values
-
loop starts. Pick least cost edge (V1,V2) from heap to merge
-
Calculate new vertex position X minimizing some metric (QEM, DF)
-
Calculate propagated error of new vertex using the E(X) = E(V1) + E(V2)
+ ME formulation
-
Relink all edges that connected to V1 or V2 to X, and call the "create
edge" routine to recalculate the heap key for these edges and change their
position in the heap.
-
Loop back to step 2, stopping when the target number of faces is achieved.
-
Finally, a visualization tool was needed to quantify how good the simplification
was in terms of quality, and for this as suggested by Gopi
I calculated the average (RMS) plane radius for a point as follows:
With this radius and a suitable multiplicative factor (100 or 1000 depending
on the amount of simplification and the model) I was able to visualize
the error accumulated at each point, which if the radius is picked right
ought to be a rough indicator of where the true surface lies, using the
concept of simplification envelopes (Jon Cohen's work).
original
cow model
|
original
bunny model
|
cow,
3000 triangles, spheres x1000, original QEM
|
cow,
3000 triangles, Variant 1 (QVEP)
|
3000
triangles, Variant 2 (DF/VEP QNV Hybrid)
|
3000
triangles, Variant 3 (DF All the Way)
|
1000
triangles, spheres x100, original QEM
|
1000
triangles, Variant 1 (QVEP)
|
1000
triangles, Variant 2 (DF/VEP QNV Hybrid)
|
1000
triangles, Variant 3 (DF All the Way)
|
250
triangles, original QEM
|
250
triangles, Variant 1 (QVEP)
|
250
triangles, Variant 2 (DF/VEP QNV Hybrid)
|
250
triangles, Variant 3 (DF All the Way)
|
1000
triangles tail view, original QEM
|
1000
triangles tail view, Variant 1 (QVEP)
|
1000
triangles tail view, Variant 2 (DF/VEP QNV Hybrid)
|
1000
triangles tail view, Variant 3 (DF All the Way)
|
bunny,
1000 triangles, spheres x1000, original
|
bunny,
1000 triangles, Variant 3 (DF all the way)
|