Discontinuous Vertex Constraints Tutorial

This tutorial will demonstrate use of the Discontinuous Vertex Constraint parameters with an Atlas UV map example.  Atlas UV maps can contain many discontinuous vertices and qemLOSS3 works particularly well on this type of UV map. For this tutorial, I will refer to the cow object in Newtek's LW_Baker: Surface Baking the Cow tutorial. If you don't want to go through the tutorial to create the Atlas mapped cow and the baked surface image, you can download my version of the Atlas_Cow. And don't forget, the techniques used in this tutorial are also valid for Weight and Color maps that contain discontinuous vertices.

This first set of images below show the original surface baked cow and the texture map. These images will be used as reference for the qemLOSS3 reductions done in the remainder of the tutorial. (Please ignore the marble-like artifacts on the surface baked cow in the following Perspective view images. The OpenGL card and driver I used for these screen captures is pretty old, and those artifacts seem to appear in Modeler's OpenGL view along the seams of the Atlas UV map. Those artifacts do not appear in Layout's OpenGL view or in the final render, and they probably won't exist on your graphic card either.)
 

Perspective view of
surface baked cow
Atlas UV map with many
discontinuous vertices

Run qemLOSS3 and set the Reduction Goal (Polygons) parameter to 3500, and the (Percent) parameter will automatically change to 63.4748%. The TXUV tab is already selected by default and you will notice that the "Constrain Discontinuous UV Maps Vertices" selection box is not ghosted. If your object did not have any UV maps at all, or if the UV maps that were assigned to the object only had continuous vertices in all the maps, the selection box would be ghosted and unavailable for use. Currently, since the  "Constrain Discontinuous UV Maps Vertices" is not selected, the "UV Map" pull-down menu and the "Weight" parameter are ghosted.

Go ahead and run qemLOSS3 without constraining the discontinuous vertices. The first image in the table below shows UV texure map with the results of the reduction (white wireframe), with the original unreduced map shown in the background layer (black wireframe). You should notice that despite the fact that we did not constrain the discontinuous vertices, most if not all of the discontinuous vertices still remain in their original locations. This is because the qemLOSS3 algorithm treats discontinuous vertices similar to areas of a mesh where the angle between polygons changes abruptly - the quadric geometric error of vertices with discontinuous UV values will be greater than vertices with continuous UV values. So in reality, the selection box should actually be labelled something like "Add More Constraint to Discontinuous Vertices". We will see more about this as the tutorial continues.

Just to compare the results of the first reduction with one in which we do add some constraint to the discontinuous vertices, switch back to the first layer with the original mesh. Now run qemLOSS3 again and this time go ahead and select the "Constrain Discontinuous UV Maps Vertices". Notice that once you select this parameter, the other 2 parameters are now unghosted, and we'll just leave those parameters alone for this run. After clicking OK, we can compare this reduction with the previous one by displaying the previous reduction's layer in the background. The second image in the table below shows this comparison, and you can see there are a few small changes to the mesh, but at this reduction level of 3500 polygons, there is not much difference between not constraining the discontinuous vertices and adding the discontinuous constraint.
 

Reduced UV texture map with the original map in the
background layer. The discontinuous vertices were
not constrained during this reduction.
Second reduction with discontinuous vertex constraint
enabled. The first reduction without the constraint
is shown in the background layer.

To actually see the benefit of the "Constrain Discontinuous UV Maps Vertices" parameter, let's do the reduction two more times, but this time we will decrease the number of polygons for the final reduction. Switch back to the original layer, and run qemLOSS3 again. This time change the Reduction Goal (Polygons) to 3000, and unselect the "Constrain Discontinuous UV Maps Vertices" parameters one more time. This time when the reduction process is complete, you will find that the geometric error weight of some of the discontinuous vertices were not great enough to prevent the discontinuous vertices from being removed from the mesh. The first image in the table below shows some mapping errors beginning to appear on the nose of the cow in the Perspective OpenGL view, and just below that image I've zoomed into a portion of the UV texture map that shows where the boundaries defined by the discontinuous vertices have been connected to other areas of the discontinuous map.

Since the number of problem areas in this reduction is small, the "Constrain Discontinuous UV Maps Vertices" parameter may be able to allow us to add enough "weight" to the geometric error metric to control to the offending discontinuous vertices. So switch back to the original layer, run qemLOSS3 again, and enable the "Constrain Discontinuous UV Maps Vertices" parameter. Once again we can leave the 2 remaining parameters alone, thus adding additional weight of "100" to all discontinuous vertices. When the reduction process is complete, the second image in the table below shows the mapping error on the nose has been eliminated, and the connections between disjoint areas no longer exists. You can compare these 2 reductions again if you would like, by displaying the previous unconstrained reduction layer in the background.
 

Mapping error begins to show on the nose of the cow,
and the UV texture map shows connections occuring
between disjoint areas of the map.
By adding the constraint, the perspective view no longer
shows the error on the nose, and the UV texture map
has no connections between disjoint areas of the map.

Despite the fact that adding constraint to the previous reduction solved the problems we saw in the unconstrained reduction, it cannot solve every discontinuous vertex reduction problem. At some point, if you request a small enough number of polygons for the final reduction, discontinuous vertices will need to be removed no matter what extra constraint weight you add to the vertices. Once discontinuous vertices have to start being removed, you will begin to see mapping errors. For example, switch back to the original layer one more time. Change the Reduction Goal (Percent) to 50%, which will be approximately 2757 polygons. Make sure the "Constrain Discontinuous UV Maps Vertices" is selected, and you can even increase the "Weight" value for every discontinuous vertex to a high value such as 100,000. Once the reduction process has taken place, you will find errors in several places of the UV texture map where discontinuous vertices had to be removed. The first image in the table below shows mapping errors on the rear and underside of the cow, which are also evident in the UV texture map view. It's not going to be possible to eliminate these errors with this much polygon reduction, because at some point between 3000 polygons and 2757 polygons, discontinuous vertices will have to be removed to meet that goal.

Finally, here is a comparison of qemLOSS3 to Decimate2 (another freely available polygon reduction plugin). Decimate2 will preserve any vertex maps in an object, but it does do anything special for discontinuous vertices. So for this comparison, I chose the 3000 polygon constrained qemLOSS3 reduction (the second image in the previous table above). That reduced object had 1509 points, which is important because the number of vertices is the "unit of measure" that Decimate2 uses for its reduction goal. So by switching back to the original layer, running Decimate2 and changing the reduction goal to 1509 points, we get the final results shown in the second image below. Since discontinuous vertices are not treated any differently than continuous ones, discontinuous vertices are removed throughout the entire reduction process, resulting in obvious mapping errors in the Perspective OpenGL view and the spider web connections seen in the UV Texture map view.
 
 

This reduction goal forces discontinuous vertices
to be removed, resulting in obvious mapping errors.
Decimate2 reduction with a goal of 1509 points, the
same number of points found in the 3000 polygon
qemLOSS3 reduction.

This tutorial demonstrated the use of the "Constrain Discontinuous UV Maps Vertices" parameter and the "Weight" parameter. However, nothing was mentioned or demonstrated about the "UV Maps" pull-down menu. There was no real need to use that pull-down menu in this tutorial, because there was only one UV map in the object, and that pull-down will only be useful if there are multiple maps that can be selected from the menu. Use of a similar pull-down menu for Weight maps wll be shown in the next tutorial, in which different weights or multipliers can be assigned to each individual vertex map.