• 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.

FSXA Mesh priority and QGIS advice needed

Messages
217
Country
azerbaijan
As a start-up project to test my skills in scenery development from mesh up to 3D object modeling, I'm working on a tiny island not far from the mainland Azerbaijan.

I've clipped the downloaded TIF file in QGIS (Raster -> Extraction -> Clipper...) so that only the island is visible. For No Data Value in QGIS Clipper menu, I can use either "0" (default) or "-32767" revealed after the metadata analysis of the TIF. I assume this is similar to NullValue in resampler. So, I wonder if I really need to input any value for No Data Value or leave it for resampler? If yes, what should be the NullValue, as 255,255,255 seems irrational considering the island is surrounded by bluish sea waters. Below is the contents of my INF file and an image to make my point clear:

[Source]
Type = GeoTIFF
Layer = Elevation
SourceDir = "."
SourceFile = "chilov_island.tif"

[Destination]
DestDir = "."
DestBaseFileName = "chilov_island"
DestFileType = BGL
LOD = Auto

2b1dede0d3bc739682e5d4e97d253fce.jpg

The island's elevation is not that much (I can barely see the contours in TMFViewer), nevertheless, I'd like to make sure that I'm on the right path in making the mesh the SDK-way.

Also, I heard that FSX prioritizes the mesh based on its LOD value regardless of BGL's actual priority in Scenery.cfg. I can see in TMFViewer that my file is LOD10 (View -> Level of Detail) while the default dem0702.bgl inside FSX/Scenery/0702/scenery is LOD9. So, is this enough justification to make sure that my mesh will be loaded on top of the default mesh for the area I'm working on? What happens or what should I do if the mesh LOD is equal to default one (a question for future development)?

Thank you very much indeed!!!
 
Last edited:
http://www.fsdeveloper.com/forum/threads/mesh-priority-and-qgis-advice-needed.440422/

I've clipped the downloaded TIF file in QGIS (Raster -> Extraction -> Clipper...) so that only the island is visible. For No Data Value in QGIS Clipper menu, I can use either "0" (default) or "-32767" revealed after the metadata analysis of the TIF. I assume this is similar to NullValue in resampler. So, I wonder if I really need to input any value for No Data Value or leave it for resampler? If yes, what should be the NullValue, as 255,255,255 seems irrational considering the island is surrounded by bluish sea waters.

NullValue as ex: 255,255,255 would be used for a RGB color/grayscale value to be ignored as "NO_DATA" in the visible / background (aka "diffuse") aerial imagery and/or the Alpha channel or stand-alone Blend Mask file.


So, instead, for a NO_DATA value you have specified in the source data, I would use a NO_DATA value of -32767 in ex: QGIS, then in FS / P3D SDK Resampler INF file [Source] section use:

"NullValue= -32767"

...or:

"NullCellValue= -32767"

https://msdn.microsoft.com/en-us/library/cc707102.aspx#SourceParameters

http://www.fsdeveloper.com/forum/threads/fsx-mesh-problem.425348/

https://www.google.com/#q=FS+SDK+Resample+"NullCellValue"+site:www.fsdeveloper.com



Also, I heard that FSX prioritizes the mesh based on its LOD value regardless of BGL's actual priority in Scenery.cfg. I can see in TMFViewer that my file is LOD10 (View -> Level of Detail) while the default dem0702.bgl inside FSX/0702/scenery is LOD9. So, is this enough justification to make sure that my mesh will be loaded on top of the default mesh for the area I'm working on? What happens or what should I do if the mesh LOD is equal to default one (a question for future development)?

If this is for personal use only, you might not be concerned over eventual competition of your custom terrain mesh with a super-imposed 3rd party terrain mesh BGL which has a lower LOD (and therefore a greater Geographic extent of ground coverage which could be loaded with top priority at a greater distance away from your custom local scenery project terrain mesh extent of coverage).

If this is for public release, you may wish to make the scenery 'future-proof' against eventual availability of a competing 3rd party terrain mesh BGL by placing mini-quads (aka "Area Points") with elevation data points at a distance of LOD-3 (aka "QMID-5") or even LOD-2 / QMID-4 ...to the N-E-S-W positions relative to the center for elevation data points within the extent of coverage in your own custom terrain mesh BGL.

Then, in ex: QGIS, assign a NO_DATA attribute to the areas between those remote Area Points and the outer borders of the extent of coverage in your custom terrain mesh BGL.


The above process could enable the source data used by FS / P3D SDK Resample to output a BGL which may allow the user aircraft to intercept and load your terrain mesh first before any other competing terrain mesh ...thus giving your mesh a greater likelihood of display priority when the aircraft eventually flies over your scenery coverage area.


FYI: The coordinates required for the remote mini-quad / Area Point positions can be determined by loading the FS / P3D default terrain mesh inside:

[FSX install path]\Scenery\0702\scenery\dem0702.bgl

...for your project area in FSX / P3D SDK TMFViewer.

Next, in that same TMFViewer session, you would display a LOD-3 / QMID-5 grid on screen, then hovering the mouse cursor over locations just outside the LOD-3 / QMID-5 grid-lines, you can then write down the cursor Geographic coordinates from the TMFViewer bottom status bar to be used in ex: QGIS ...to create your 'remote' elevation data points used to 'artificially' expand your custom FS terrain mesh LOD ground coverage extents. ;)


Hope this helps ! :)

GaryGB
 
Last edited:
So, instead, for a NO_DATA value you have specified in the source data, I would use a NO_DATA value of -32767 in ex: QGIS, then in FS / P3D SDK Resampler INF file [Source] section use:

"NullValue= -32767"

...or:

"NullCellValue= -32767"

https://msdn.microsoft.com/en-us/library/cc707102.aspx#SourceParameters

http://www.fsdeveloper.com/forum/threads/fsx-mesh-problem.425348/

https://www.google.com/#q=FS+SDK+Resample+"NullCellValue"+site:www.fsdeveloper.com

Thank you, GaryGB! So far so good...

If this is for public release, you may wish to make the scenery 'future-proof' against eventual availability of a competing 3rd party terrain mesh BGL by placing mini-quads (aka "Area Points") with elevation data points at a distance of LOD-3 (aka "QMID-5") or even LOD-2 / QMID-4 ...to the N-E-S-W positions relative to the center for elevation data points within the extent of coverage in your own custom terrain mesh BGL.

Then, in ex: QGIS, assign a NO_DATA attribute to the areas between those remote Area Points and the outer borders of the extent of coverage in your custom terrain mesh BGL.

The above process could enable the source data used by FS / P3D SDK Resample to output a BGL which may allow the user aircraft to intercept and load your terrain mesh first before any other competing terrain mesh ...thus giving your mesh a greater likelihood of display priority when the aircraft eventually flies over your scenery coverage area.

FYI: The coordinates required for the remote mini-quad / Area Point positions can be determined by loading the FS / P3D default terrain mesh inside:

[FSX install path]\Scenery\0702\scenery\dem0702.bgl

...for your project area in FSX / P3D SDK TMFViewer.

Next, in that same TMFViewer session, you would display a LOD-3 / QMID-5 grid on screen, then hovering the mouse cursor over locations just outside the LOD-3 / QMID-5 grid-lines, you can then write down the cursor Geographic coordinates from the TMFViewer bottom status bar to be used in ex: QGIS ...to create your 'remote' elevation data points used to 'artificially' expand your custom FS terrain mesh LOD ground coverage extents. ;)

Sounds like a 'super-duper' tip, thanks! Sorry for my ignorance but I'm not sure am following your point (yet). Just found a couple of other posts with your recommendations re: "area points" (a.k.a 'mini-quads') like this one and this one. Will report back after reading them all... :)
 
Last edited:
Also, I heard that FSX prioritizes the mesh based on its LOD value regardless of BGL's actual priority in Scenery.cfg. I can see in TMFViewer that my file is LOD10 (View -> Level of Detail) while the default dem0702.bgl inside FSX/0702/scenery is LOD9. So, is this enough justification to make sure that my mesh will be loaded on top of the default mesh for the area I'm working on? What happens or what should I do if the mesh LOD is equal to default one (a question for future development)?

http://www.fsdeveloper.com/forum/threads/mesh-priority-and-qgis-advice-needed.440422/#post-775450

Sounds like a 'super-duper' tip, thanks! Sorry for my ignorance but I'm not sure am following your point (yet). Just found a couple of other posts with your recommendations re: "area points" (a.k.a 'mini-quads') like this one and this one. Will report back after reading them all... :)

You are correct that in most aerial imagery LOD display priority scenarios, the higher LOD BGL should render on top of other active BGLs covering the same area.

But FS has a 'quirky' way of rendering terrain mesh BGLs that can be thought of as a "reverse priority" when it deals with LODs and geographic extents of coverage. :alert:

Or, worded differently: (Extent) SIZE MATTERS. :D


A terrain mesh BGL has highest priority when its Geographic extent of terrain coverage is larger, and/or when it is first to load, because, for flights spawned outside the extent of coverage for a smaller local higher resolution terrain mesh BGL, FS does not dynamically adapt and re-render the ground shape for that smaller area of higher resolution (higher LOD) terrain mesh ...as the user aircraft flies into the area of coverage for that latter higher LOD terrain mesh BGL.

If a flight is spawned within a smaller area of higher resolution (higher LOD) terrain mesh it is rendered for that locally started flight session.


Some threads on this topic:

http://www.fsdeveloper.com/forum/threads/higher-lod-terrain-not-drawn.435658/


https://www.google.com/#q=site:www.fsdeveloper.com+GaryGB+Holger+terrain+mesh+priority


Hope this helps with better understanding the FS "reverse mesh priority" behavior. :)

GaryGB
 
Last edited:
Hi Gary,

I've read and (hopefully) understood your tips above. Thank you very much indeed, as you've helped to broaden my understanding of how FSX works internally with all these scenery priorities, LODs, etc.

So, the general idea is to sort of 'expand' the custom mesh coverage by placing 'mini-quads' at lower LODs, eg. 3 or even 2, to make it visible in FS even if the flight starts outside the intended (small) coverage but still within the bigger area limited to these lower LODs (if I can eventually succeed in placing the mini-quads). If true, how I can actually expand the coverage up to LOD3 boundaries using the downloaded DEM file, which covers only a small portion of land, and the available tools (SDK + QGIS). For I can (mistakenly?) see no other option than downloading and resampling a source file covering much bigger area, if that's what you mean... :( Can you please elaborate?

Also, is it then possible to verify in FSX that the custom mesh is indeed loaded on top of any other mesh data?

Thanks!
 
Last edited:
Hi Gary,

I've read and (hopefully) understood your tips above. Thank you very much indeed, as you've helped to broaden my understanding of how FSX works internally with all these scenery priorities, LODs, etc.

So, the general idea is to sort of 'expand' the custom mesh coverage by placing 'mini-quads' at lower LODs, eg. 3 or even 2, to make it visible in FS even if the flight starts outside the intended (small) coverage but still within the bigger area limited to these lower LODs (if I can eventually succeed in placing the mini-quads). If true, how I can actually expand the coverage up to LOD3 boundaries using the downloaded DEM file, which covers only a small portion of land, and the available tools (SDK + QGIS). For I can (mistakenly?) see no other option than downloading and resampling a source file covering much bigger area, if that's what you mean... :( Can you please elaborate?

The general idea is to use ex: QGIS to assign a NO_DATA attribute to any area between the centrally-located elevation data points for the smaller area of high resolution DEM, and the manually-defined elevation data points which are Geographically located just outside the MSFS terrain grid quad borders of a LOD-2 or LOD-3 size coverage area.


Also, is it then possible to verify in FSX that the custom mesh is indeed loaded on top of any other mesh data?

Thanks!

One would test this by starting a flight in FS outside the Geographic extent of coverage for the actively loaded custom terrain mesh BGL, then flying into the known Geographic extent of coverage for the centrally-located elevation data points of that smaller area of high resolution custom terrain mesh ....to see if any unique features and/or elevations known to exist at specific Geographic coordinates within that BGL are displayed in FS at run time.


I am traveling right now, and will not be able to reply in greater detail until some time until after the next day or so.:cool:

GaryGB
 
Last edited:
Back
Top