• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FS2004 Compiling Mesh

Messages
51
Country
canada
Hi guys, I didn't want to steal someone else's thread (although it was very helpful in understanding Global Mapper), I now have my DEM file spanning N63, W-116, S62, E-114, and want to compile a LOD11 mesh from it. I have Richard Ludowise's LOD Extents Calculator (LEC.exe) to calculate the destination bounds but what I'm not clear over is do I have to make numerous small LOD11 bgl's, ie

N62.578125
W-114.43359375
S62.5341796875
E-114.4921875

and then the next tile to touch and so on or can I use his tool to work out the largest corners possible from my source file (which i think would be this)

N62.9736328125
W-115.95703125
S62.0068359375
E-114.0234375

and then compile one large bgl file?

This is the inf file I've put together, I read the SDK so I think I've done it properly. Does it look correct?

Code:
[Destination]
	; The [Destination] section defines the output of the resampler

	; LOD = {Auto, 0..n}
; LOD = Auto tells the resampler to pick the closest LOD to the 
; source cell size.  Specifying a number will force an LOD.  
; This can be used for under sampling or over sampling.
	LOD	= 11
	
	; DestDir – Tells the resampler where to put the resulting files.
	;           “.” is the directory containing the .inf file.
	DestDir		 = ".\scenery"

	; DestBaseFileName – The name to give the resulting .bgl file
	DestBaseFileName 	 = "085J_LOD11"

	; UseSourceDimensions – See docs.
	UseSourceDimensions = 0
	NorthLat = 62.9736328125
	SouthLat = 62.0068359375
	EastLon = -114.0234375
	WestLOn = -115.95703125
	
[Source]
	Type			= ElevS16LSB
	SourceDir		= "H:\Geobase\CDED\50k\085"
	SourceFile		= "085j_compiled.dem"
	Lat			= 63
	Lon			= -116
	NumOfCellsPerLine = 9601
	NumOfLines		= 4801
	CellXdimensionDeg = 0.000208333
	CellYdimensionDeg = 0.000208333
	ScaleinMeters	= 1.0

Thanks in advance for the help!
 
Hey benclark,

First of all I edited your config file above to read it better without all those comments:

Code:
[Destination]
LOD = 11
DestDir= "."
DestBaseFileName= "085J_LOD11"
UseSourceDimensions = 0
NorthLat = 62.9736328125
SouthLat = 62.0068359375
EastLon = -114.0234375
WestLOn = -115.95703125
	
[Source]
Type			= ElevS16LSB
SourceDir		= "H:\Geobase\CDED\50k\085"
SourceFile		= "085j_compiled.dem"
Lat			= 63
Lon			= -116
NumOfCellsPerLine = 9601
NumOfLines		= 4801
CellXdimensionDeg = 0.000208333
CellYdimensionDeg = 0.000208333
ScaleinMeters	= 1.0

However I have several "things" which are quite a bit another way I am doing them.
For example, my config file for my mesh for EDRJ:
Code:
[Destination]
LOD = 11
DestDir = "."
DestBaseFileName = "Terrain_EDRJ"

[Source]
Type = ElevS16LSB
SourceDir = "."
SourceFile = "ASTGTM2_N49E006_dem.bil"
Lat = 50
Lon = 6
NumOfCellsPerLine = 3601
NumOfLines = 3601
CellXdimensionDeg = 0.000277777777777778
CellYdimensionDeg = 0.000277777777777778

I do not have those coordinates in the [DESTINATION] part, however it might be that this is good, I have really no clue about this.
However since you said you used GlobalMapper, how did you compile your mesh?
Here is a little explanation how I do it and I never needed that application to calculate the coordinates. I use the ASTER source data for mesh and I never cut or modify the mesh I get in order to have a more or less perfect mesh. (Sometimes you need to clean up those parts where there is no source data, but this never happened to me until now.) So maybe you have another approach on this. Anyway here how I do it:
Code:
1) Start GlobalMapper
2) Load *_dem.tiff file
3) Datei --> Batch File Conversion OR Batch Convert/reproject
4) Select GEOTIFF
5) Select BIL (16-bit Elevation Samples)
6) Add Files --> Add the file which are source
7) Select output folder
8) Select:
   - Force square pixels in output
   - Fill small gaps in Data
   - Show Batch Conversion Progress
9) Select as Horizontal Datum WGS84.
10) Click ok!
11) Take the new file and resample.exe it!

Maybe this helps you. Hope this helps you a bit.
Just one thing for the LOD number. I would suggest to use AUTO as LOD setting because it can be that your mesh has a lower resolution than LOD11 and then it can be that the whole mesh looks more awful than it really is. This happened to me once and since then I use LOD=AUTO as setting.

In addition, make a backup of your source file for the mesh and try to compile it out, this is the best method to learn from the mistakes you do and it helps much in understanding the compilers and also a bit the sim :)

hope this helped you at least a bit
 
Hi Kevin yes I believe the coords are needed in the destination part, otherwise I could try compiling each file as is but because it doesn't line up exactly with the LOD grid that the sim uses it results in a gap between adjacent tiles. The free mesh available on Simviation is a perfect example of this with large gaps in between each adjacent tile, less visible on flatlands but you can imagine mountain ranges. Right now this mesh is in the middle of the country and is primarily a test to make sure I'm doing things right and processing everything correctly. When I do the final mesh I intend to start at the side of the country and work my way across in that way I'll have nice uniform areas covered with each bgl file. Otherwise my files would be {MESH}(fillermesh){MESH}(fillermesh) and so on where I would have to go back and create additional smaller mesh files to fill in the gaps.

The method you posted was what I found in that thread I didn't want to hijack lol, I just changed step 4 as I'm working with the CDED data files which aren't in Geotiff but DEM format.

Our INF files are basically the same just mine has those additional lines at the top. You've never needed them I would guess as you are making base mesh for your airport scenery and not needing to worry about tiling your mesh with adjacent tiles. I'm trying to cover the whole of Canada and so have to do it in tiles.

Since the INF files are basically the same I think I've done things right. I won't really know till I compile two adjacent tiles though! Here's hoping it works, I can make AI flightplans, paint aircraft and do ADE work, mesh is still that stumbling block lol!

Edit - Oh and I chose LOD11 as the source files have a resolution of 0.75 arc seconds or 0.75 × 30m = 22.5m resolution which is very close to LOD11's 19.1m, much closer than LOD10 at 38.2m and losing that much detail would be pointless, although I will still be making both and comparing them as FS doesn't always pick its points sensibly so yes the LOD10 could ultimately look better!
 
Last edited:
It worked! I did that first compile and no problems (once I had exported it to BIL format, forgot to do that step originally :banghead: ), so then I used Richard's LEC tool to select a LOD boundary somewhere around the -115 Longitude mark, and then created two duplicate INF files altering the E and W points respectively with that new LOD boundary. Compiled them in to a _Left.bgl and _Right.bgl file before opening them both in TMFViewer and confirming not a single pixel gap between them! :D

Thanks for the help, now time to make the mesh for real! I'm sure I'll have more questions as I work my way down to the Canada/US border as I'll be combining the CDED data and one of the US data sources at that point to again get a clean mesh edge. Now if only TMF showed me anything other than a green rectangle (don't worry I can see the heights are correct, just can't see any detail as the range of values is too small!)
 
Now if only TMF showed me anything other than a green rectangle (don't worry I can see the heights are correct, just can't see any detail as the range of values is too small!)

Set the "Elevation Color Ramp" to match your limits.
 
Where is that option in TMFViewer?

Found the next thing I need to fix, that file fixed the elevation around Yellowknife very nicely, but I've got to do all the lakes now too.

You can see the terrain before -
7705606876_348e40e73d_b_d.jpg
and after -
7705607852_b12d0e62ee_b_d.jpg


Good thing that Geobase supply the National Hydro Network data! I assume that I do in SBuilder?
 
Just Canada for now, Holger did some great BC mesh but the rest of Canada is totally untouched on a good freeware scale. Now I've got this figured out it won't hopefully take me that long to make the mesh, then I'll do the water (lakes, rivers, coastline, etc.) before moving on to possibly roads, railways and so on.

With regards to making this for FSX too I need a 32-bit BIL source file, not 16-bit and I need to use the FSX version of resample yes? I would like to make both as FSX would ultimately be my sim of choice (as it is for many other people), my laptop just can't run it well enough sadly.
 
Hey guys everything is going great and using the FSX version of TMFViewer (didn't think it would work for the FS9 mesh) I can see everything is lining up properly with the LOD borders and my first two tiles have no gaps between them so things look great.

With regards to compiling the same source data for FSX, I just want to check, I need to save it as a 32-bit BIL file and then compile obviously using the FSX version of resample. Do the settings in the INF file need to differ? Are the LOD boundaries the same? I assume they are as the LEC tool doesn't give FS9\FSX settings beyond the name of the file containing the original mesh.

Thanks for the help!
 
Hi Ben.

You don't need 32-bit data. In fact, I think you can even use the same INF file, and use it with the FSX resample.

Also, the FS9 mesh will work in FSX, so you don't really need to do anything.

Dick
 
Thanks Dick, I figured the FSX mesh needed to be compiled specially for it as I know they changed the world was drawn in FSX over FS9. If it doesn't then that's great as it'll save me half the work!

BTW big thanks for your LEC tool, without it the work I'm doing right now wouldn't be possible, it's the first time I've managed to make adjacent mesh tiles without any gaps in it!

Finally, updated my FS9.cfg terrain_max_vertex_level to 21 and then realised something, why bother, 20 is good enough as FS9 can't display any mesh better than LOD10 which is hard coded in, only FS2002 and FSX can display mesh at LOD11?
 
Regarding my last sentence I answered my own question when I realised that the 9.1 update enabled LOD 11 support.

Figured I'd share another picture, this time the in-game map to show the difference between default mesh and upgraded mesh! To say the difference is huge would be an understatement!

7739507488_4b201ab4e1_d.jpg


It shows how badly I need to update the waters of Canada too, horribly positioned lake's, hundreds of them missing and I've barely covered the eastern shore of Newfoundland yet! That big lake at the top is Ten Mile Lake and you can see where all the missing lakes should be.

Needless to say I think the investment of time I'm going to put in to this is going to be huge! I must be insane!
 
I seem to recall that Canada has over 60% of the world's freshwater lakes... true or not, it has lots of lakes.

I also thought the Canadian government had shapefile data of the lakes. That would be easier than drawing them all, if the data exists.

Dick
 
Canada indeed has a lot of lakes, more than 2 million! Yes the data does exist, I have the complete National Hydro Network and National Road Network data (shapefile format), will just have to learn how to use SBuilder to import it. Great data though, includes every kind of water formation you could imagine, needless to say once I'm done Canada is going to be a lot lumpier and a lot wetter than Microsoft made it!

One question you may be able to help me with Richard, using Global Mapper or Microdem to open the source files I can see that both programs display the elevations as fractions of a meter. 14.1m in Microdem for example or 14.065 in Global Mapper. How do I know that these values are in the source data and not just the programs interpolating the data displayed? I did try using the FractionBits setting (in all three ways in the inf file, Source only, Destination only and then both) without success, each time getting warned about a precision loss.

When I convert the DEM to a BIL in Global Mapper I am setting the Vertical Units to Metres, could that be causing a problem, perhaps only storing Integer values in the BIL file, setting it to Decimetres would display the Microdem values? setting to Centimetres would be closer to the Global Mapper values but again I don't know if those values are truly there in the source data and obviously I don't want to screw around with the source data creating information that isn't there as that just brings inaccuracy with it. If I try this out then I assume I would need to change the "ScaleinMeters" setting to 0.1 for Decimetres or 0.01 for Centimetres.

Thanks once again for your help!
 
Found the best (so far) before and after comparison, Bell Island (the Grey Island's one)

Before-
7743468062_77423b9465_b_d.jpg


After-
7743467234_4a24a03f04_b_d.jpg


Obviously I can't wait to fix the shorelines, it can be seen right now to be having a good amount of impact on the quality of the terrain (the stepping on the left as the shoreline is not yet correct), I was also interested to see how close you have to be to see the full quality of the mesh. The higher the LOD the lower and slower you need to be flying to truly appreciate it!
 
Yes, those cliffs I had problem with that too, the sad things is that in most of the areas the mesh is correct, but are those cliffs that I don't now how to fix. in your case not should be such a problem because they are lakes and a big zone, but I am talking on just one island.
 
Hey guys while waiting for a reply to my other thread I've been working on the lakes. Hit a snag though, can get the data in to the sim (FS9) but all the lakes are at 0 elevation while there is also in the same BGL a huge pile of water that extends up to between 30-60000ft! So how do I in FS9 get the lakes to be mesh clinging water as sadly the Shapefile's that Geobase provide do not include elevation data and I'll be buggered if I'm hand entering data for over 2 million lakes! I'm also seeing problems like this in TMFViewer

7757031210_bc423f7d2c_b_d.jpg


yet I see no issues that should be causing the 30-60000ft water problem, that screwed up appearing area is tiny in comparison to the problem area. Indeed at that point in-sim beyond the 0 altitude lakes there are no issues that I can see. :s
 
Hi Ben.

You could import the lakes into SBuilderX, then export these as BLN into SBuilder9. I don't know what process you are using to get the data into FS9.

Another route is to convert the lakes to KML with gdal, then use a BLN converter on them. I've got a crude one that seems to work.

Could you zip a problem shp file and attach it to a post?

Dick
 
Hi Dick that's exactly what I was doing. Full process as follows.

Open Shapefiles (5 in total) in Global Mapper
Reproject to WGS84
Export combined Shapefiles as a single Shapefile
Open single Shapefile in SBuilderX
Export Shapefile as a BLN file
Open BLN in SBuilder with LWM Water setting and -9999 altitude
Select Lines and delete
Select Polygons and Compile

To work out which Shapefile is causing the issue I'll treat them each seperately with that process, hell combining them together could be causing the issue although I seriously doubt it. Once I've worked out which one is causing the problem I'll send it over.
 
Ok well I was going to do that but I'm getting non-stop Runtime error '52''s when I try and import the BLN in to SBuilder. Any ideas on that one?
 
Back
Top