Caution: only tested with
MSFS 2002 and 2004

Mesh gaps

There is a detail in the construction process that is often overlooked by newcomers to mesh construction. The diagrams below (not to scale!) illustrate the problem, how to minimize it, and how to identify it in your mesh. While I use GTOPO30 data in this example, the principles apply to all mesh constructed with the SDK.

From the SDK: "Since the resampler's output consists of quadrants at a given LOD...".

Resample.exe (and the sim) uses its own internal reference system, with dimensions determined by the LOD (origin at N00 E000 - the Equator and Prime Meridian).

Figure A represents 4 GTOPO30 regions, each of which, outlined in green, is 40 degrees wide and 50 degrees tall. This is too large an area to work with in FSTerrain, so we decide to "subdivide" each GTOPO30 region into 10 degree by 10 degree blocks (the largest supported by FSterrain).

Figure B represents a single 10 x 10 degree subset of the GTOPO30 data, on which I have overlayed a grid (blue lines) representing LOD quadrants for an arbitrary LOD level. Only the blue shaded areas (full LOD quadrants) will be included in the final bgl file and displayed in the sim at the higher resolution - the grey perimeter within the 10 by 10 degree block will still be displayed with the default resolution mesh. (Larger LOD values produce smaller grids and less loss, but there will always be some loss.)

The overall effect is a patchwork of default and improved mesh covering the 40 degree by 50 degree area. Figure C represents the red 4 unit subset processed in this way. This effect is noticeable in mesh created with GTOPO30 data, and can produce steep cliffs along these borders in rough terrain when higher resolution source data is used.

One solution is to use more, and smaller, blocks. These blocks must be large enough to include the entire LOD quadrants along the borders of two adjacent sides. An extra one degree is adequate here since, for an LOD of 7, each LOD grid has a width of  0.9375 degrees, and height of  0.703125 degrees.

For example: For an LOD of 7, I have used 8 degree x 7 degree blocks but specify 9 degree by 8 degree coordinates in FSTerrain for each of these. Any size block is ok, and you will have to adjust the size for the right and bottom rows, but I hope the concept is clear. (Using appropriate calculations, greater precision is possible, but the result will be the same.)

Below is a sample from the Excel spreadsheet I use. It serves as both a checklist and log of work completed. If you use a different LOD, you will have to adjust the table accordingly.

-10540 / 480540 / 480540 / 480540 / 480480 / 480
-17540 / 480540 / 480540 / 480540 / 480480 / 480
-24540 / 480540 / 480540 / 480540 / 480480 / 480
-31540 / 480540 / 480540 / 480540 / 480480 / 480
-38540 / 480540 / 480540 / 480540 / 480480 / 480
-45540 / 480540 / 480540 / 480540 / 480480 / 480
-52540 / 480540 / 480540 / 480540 / 480480 / 480

Figure A. Here we have shifted the source of the second area (2) to the left, overlapping the source used in area 1.

Figure B. The blue shaded area indicates the same coverage as that provided above, while the green shaded area is included in the area 2 bgl. The line labeled 1 below the figure shows the longitude range covered by area 1, and the line labeled 2, at the top-right corner of the figure, identifies the left end of the range covered by area 2. Note the overlap of 1 and 2.


Figure C. Figure C represents the red 4 unit subset processed with the appropriate overlaps along both the right and bottom borders. The entire interior area is now rendered with the improved mesh data.

The same problem exists along the outside borders of the overall 40 x 50 GTOPO30 area, but I will not address that situation here. The solution is more complex, and probably not worthwhile for low resolution mesh.

It is easy to check for this phenomenon in the mesh. In the example above, you could go to almost any 10-degree boundary (e.g. N35 E20). Once over such a boundary, take two screenshots with the aircraft facing North, one with the default mesh, and one with the enhanced mesh. If the problem exists, there will be no difference in the terrain under the aircraft.