Friday, April 24, 2009

So How Big of a Mesh Can You Build?

I get asked about the maximum mesh density in X-Plane a lot.

First, I must note that X-Plane's mesh is adaptive - the triangles are not arranged in a grid, but rather they're arranged to maximize the quality of the mesh with minimal triangle count, while preserving the outlines of water bodies and airports. These pictures show a dynamic mesh fit to a section of the grand canyon (both with and without the shaded DEM for reference):

Second, the actual maximum mesh density is almost certainly limited by system resource constraints. The maximum spatial resolution in a DSF is about 0.6 millionths of a foot. You're going to exceed the maximum number of vertices, or much more likely, the maximum amount of available memory in X-Plane long before you have a grid at that resolution.

(That doesn't meant that resolution isn't usable - remember, the idea of the adaptive mesh is to have very high densities in very improtant places, but not everywhere.)

But in practice this is all moot if you don't code your DSFs by hand - the question that really matters is: what is the highest density mesh that you can use with the current scenery tools.

Until recently, MeshTool was limited to a 1201x1201 (90 meter) input DEM. The input DEM is a simple grid, and the finished DEM is never higher resolution than the input. So until now, it would have been just about impossible to make a really high res mesh, even if X-Plane could handle it.

The most recent changes to MeshTool fix this - MeshTool can now handle a 10801 x 10801 (10 meter) input DEM, which X-Plane should be okay with as well.

This new version will hopefully go into beta relatively soon.


alpilotx said...

Hi Ben,

I think you should put those very good example pictures into the X-Plane Wiki too, where you explain the regular vs. irregular mesh stuff in the MSFS section.

BigG said...

I mostly fly helicopters in mountain areas, so it would be great to have some flat parts to land. I work a lot with GIS data and I can get a lot of high resolution DEMs, from 90m to 2m. I tried to use a 25m resolution to create 4 scenes in meshtool and the results are quite bad... nothing really changes... I used GDAL to convert my DEM to .tif and latitude-longitude. Meshtool works well. But really the results are not differents from the original scenery.

It's very frustrating to see that Google Earth has better topography and better textures than x-plane. I wish we could use x-plane to fly in google earth...

Benjamin Supnik said...

If you increase the mesh res but don't tweak the mesh params, you won't see any change in quality. Make sure to set the mesh params for decreased error limits too.

BigG said...

...thanks a lot ! It worked perfectly. Meshtools has a few errors if I try to get the mesh over 1 million points but under this the results are already better.

Thanks a lot for your help.