L3DT development blog
Large 3D terrain generator

August 22

Mesh edge optimisation

Hi All,

An update to the mesh decimator plugin is now available that fixes a problem with poor mesh optimisation along the north and east edges of untiled mesh exports. In previous versions of the mesh exporter (including the exporter in L3DT release 11.08), maps with sizes that were not equal to a magic size would have their north and east edges fully unoptimised, resulting in an excessive and unwanted number of triangles along these edges, as shown below:

Unoptimised north and east edges
(orthographic view in Blender).

This problem was due to a limitation of my implementation of the ROAM split-only tessellator. Fortunately, after some deep thought I worked out a way to make the renderer fully optimise the partially unfilled edge tiles for all map sizes. The screenshot below shows the new output of the updated mesh decimator, wherein you can now see that the north and east edges have been properly optimised:

Correctly optimised edges all around.
(This is the same heightfield as in the previous image.)

Variable lateral vertex spacing

Eagle-eyed readers may notice that the triangles along the north and east edges of the map are not isosceles right-angle triangles, whereas the triangles across the rest of the map are. This slight skewing of the lateral vertex spacing near the edges is a harmless side-effect of the method I used completely fill the tessellator edge tiles. However, this skewing may cause problems if you use a mesh renderer that assumes a constant lateral vertex spacing (why it would do this I cannot imagine, but I'm trying to be thorough.) In such cases, I recommend you resize the map to one of the magic sizes before export.

Magic sizes

The 'magic' map sizes that did not cause unoptimised mesh edges in the old exporter, and that avoid variable lateral vertex spacing in the new exporter, must be an integral multiple of 64 plus one in each dimension. Some 'magic' sizes are the old power-of-two plus one sizes:

65 129 257 1025 2049 4097 etc…

…and also some in-between sizes:

193 321 385 449 577 641 etc…

Getting the update

The updated plugin will be included in the next developmental build of L3DT, for which there is no definite ETA. If you would like the update now, the plugin is available here. To use the plugin, extract it from the zip archive, and copy it over the existing plugin at:

Win32 C:\Program files\Bundysoft\L3DT [version]\Extensions\atMeshDecimator.zeo
Win64 C:\Program files (x86)\Bundysoft\L3DT [version]\Extensions\atMeshDecimator.zeo

Please let me know (in the forum) if you find any problems with this update.

Best regards,

2011/08/22 09:38 · aaron
blog/2011/08-22.txt · Last modified: 2017/08/31 05:55 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
L3DT Development Blog RSS Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki