stevefsp / critterai

Archive of CAINav Project (Inactive)
MIT License
127 stars 75 forks source link

Seams Form Between Triangles within a Region #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Seams in the final detail mesh form between triangles in the same region.  This 
happens when using the contour parameters which add internal detail.  
(contourSampleDistance, contourMaxDeviation)

This issue can only happen when contourSampleDistance > 0 since that is the 
only time internal vertices are added to a region.

The cause appears to be a failure of the Delauney triangulation, specifically 
the portion of the algorithm which detects edges-vertex intersection.  In the 
cases seen so far, edges have been added that improperly pass across vertices.  
(Floating point error issue?)

Workaround:  Adjusting the contour parameters and other parameters that effect 
vertex positioning can sometimes fix the issue.

Original issue reported on code.google.com by steve...@gmail.com on 11 Aug 2010 at 4:45

GoogleCodeExporter commented 9 years ago
Upon further investigation it was found that the issue occurs on shared edges 
between polygons, either within the same region or other regions.

The root cause was not the triangulation, but rather deviations when adding 
detail vertices along shared polygon edges.  Sometimes shared edges were being 
build slightly differently, resulting in seams.

The algorithm in DetailMeshBuilder responsible for building the height patches 
was the cause.  In certain cases the height patch data near shared vertices 
deviated slightly for different polygons.  So edges that shared the vertices 
built differently.

Fixes committed at part of r122.  Testing still underway.

Original comment by steve...@gmail.com on 13 Aug 2010 at 6:28

GoogleCodeExporter commented 9 years ago
Distributed as part of NMGen-0.2.0.

Original comment by steve...@gmail.com on 31 Aug 2010 at 5:22