Level Of Detail (LOD) Ranges: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
No edit summary
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Level of Detail (LOD) is controlled by three properties in FlightGear, with the following default values:
'''Level of detail''' ('''LOD''') '''ranges''' are controlled several properties in FlightGear, with the below default values.
* /sim/static-lod/detailed=1500
* /sim/static-lod/rough=9000
* /sim/static-lod/bare=30000


These properties control the distance at which various parts of the scenery become visible. They are also used by aircraft modellers to control the visibility of different aircraft parts.
== Scenery ranges ==
{{note|The LOD ranges are only set during the scenery loading process. Therefore a scenery reload may be required to change the currently loaded tiles.}}
{| class="wikitable"
|-
! Property !! Default !! Description
|-
| <code>sim/rendering/static-lod/detailed</code> || 1500 m ||All objects (buildings etc) display withing this range.
* Building meshes using OBJECT_BUILDING_MESH_DETAILED
* The actual visibility range is randomly distributed from <code>/sim/static-lod/rough</code> to twice <code>/sim/static-lod/rough</code>, to reduce apparent "popping".
|-
| <code>/sim/rendering/static-lod/rough</code> || 7500 m || Terrain and non terrain objects will be displayed within this range, as follows:
* Objects listed in scenery STG files using OBJECT_STATIC or OBJECT_SHARED verbs
* Random scenery objects
* Random trees
* Random buildings
* Building meshes using OBJECT_BUILDING_MESH_ROUGH.  


We also have the following settings used for AI models:
The actual visibility range is randomly distributed from <code>/sim/static-lod/rough</code> to twice <code>/sim/static-lod/rough</code>, to reduce apparent "popping".
* /sim/static-lod/ai-range-mode-pixel=false  - this is used to change the LOD model to use apparent pixel size rather than distance
|-
* /sim/static-lod/ai-detailed=10000
| <code>/sim/rendering/static-lod/bare</code> || 21000 m || Only terrain after this point
* /sim/static-lod/ai-bare=10000 - currently commented out
|}
* /sim/static-lod/ai-interior=50


== AI/MP ranges ==
{{Note|For a while now FG supports size based LOD - this is the size of the model on screen in pixels and can be configured in the static lod dialog. All models should have an assigned fallback model; this is a low detail model that can be used for models that are further away.<ref>https://sourceforge.net/p/flightgear/mailman/message/37220137/</ref>}}


They are used to control the loading and visibility of scenery elements as follows:
AI/MP models (other models that aren't being flown/operated by the user) have two models. The first of these is the low detail (or fallback) model, which can be defined by an model developer (<code>sim/model/fallback-model-index</code>) as one of the values in <code>$FGData/AI/Aircraft/fallback_models.xml</code>. When there is no fallback model defined for a model the blue-yellow glider will be used.


== /sim/static-lod/bare ==
AI/MP ranges can either bet set as pixels of the object on screen, or distance from the viewer in meters.  This is controlled by the <code>/sim/rendering/static-lod/aimp-range-mode-distance</code> property.
* Scenery tiles
{| class="wikitable"
|-
! Property !! Default !! Description
|-
| <code>/sim/rendering/static-lod/aimp-range-mode-distance</code> || false || Configures the range mode:


== /sim/static-lod/rough ==
* If set to false the values of <code>/sim/rendering/static-lod/aimp-detailed</code> and <code>/sim/rendering/static-lod/aimp-bare</code> are pixels on the screen.  This is default.
* Objects listed in scenery STG files using OBJECT_STATIC or OBJECT_SHARED verbs
* If set to true, the values are distance from the camera in meters.
* Random scenery objects
|-
* Random trees
| <code>/sim/rendering/static-lod/aimp-detailed</code> || 400 px || This property works differently depending on the range mode.
* Random buildings
* In pixel mode it is the size (in pixels) of the object on screen. When greater than this amount of pixels the detailed model will be used
* Building meshes using OBJECT_BUILDING_MESH_ROUGH. (Additional 1414m is added as these meshes are 2000mx2000m)
* In range mode it is the distance from the viewpoint, when within this range the detailed model will be used.
|-
| <code>/sim/rendering/static-lod/aimp-bare</code> || 0 px || This property works differently depending on the range mode.
* In pixel mode it is the minimum size (in pixels) of the object on screen.
** If the object is below <code>/sim/rendering/static-lod/aimp-bare</code> pixels in size, it will not be displayed.
** When the number of pixels is between <code>/sim/rendering/static-lod/aimp-bare</code> and <code>/sim/rendering/static-lod/aimp-detailed</code>, the low detail (fallback) model will be used.


The actual visibility range is randomly distributed from /sim/static-lod/rough to twice /sim/static-lod/rough, to reduce apparent "popping".
* In range mode it is the distance beyond the <code>/sim/rendering/static-lod/aimp-detailed value</code>,  at which the low detail model will be used.  I.e. the low detail model will be used in the range from <code>/sim/rendering/static-lod/aimp-detailed to (/sim/rendering/static-lod/aimp-detailed + /sim/rendering/static-lod/aimp-bare)</code> .
|-
|<code>/sim/rendering/static-lod/aimp-interior</code>
|200m
|Range at which to display the model interior (when the model has a mesh defined as being the interior).
|}


== /sim/static-lod/detailed ==
== Related content ==
* Building meshes using OBJECT_BUILDING_MESH_DETAILED (Additional 1414m is added as these meshes are 2000mx2000m)
=== Wiki articles ===
* [[FlightGear configuration via XML]].  See in particular the section [[FlightGear configuration via XML#Adding your own settings|Adding your own settings]].


The actual visibility range is randomly distributed from /sim/static-lod/rough to twice /sim/static-lod/rough, to reduce apparent "popping".
=== Forum topics ===
* {{forum link|t=37353|title=3d models, how to produce them in an understandable way}} (April 2020-) - Touches on the subject of not using LOD range animations in scenery models.


=== Source code ===
* {{fgdata source|path=defaults.xml}}. Do not change this file, rather follow [[FlightGear configuration via XML#Adding your own settings|these instructions]].
* {{simgear source|path=simgear/scene}}


== References ==
[[Category:Rendering]]
{{Appendix}}

Latest revision as of 20:52, 17 December 2023

Level of detail (LOD) ranges are controlled several properties in FlightGear, with the below default values.

Scenery ranges

Note  The LOD ranges are only set during the scenery loading process. Therefore a scenery reload may be required to change the currently loaded tiles.
Property Default Description
sim/rendering/static-lod/detailed 1500 m All objects (buildings etc) display withing this range.
  • Building meshes using OBJECT_BUILDING_MESH_DETAILED
  • The actual visibility range is randomly distributed from /sim/static-lod/rough to twice /sim/static-lod/rough, to reduce apparent "popping".
/sim/rendering/static-lod/rough 7500 m Terrain and non terrain objects will be displayed within this range, as follows:
  • Objects listed in scenery STG files using OBJECT_STATIC or OBJECT_SHARED verbs
  • Random scenery objects
  • Random trees
  • Random buildings
  • Building meshes using OBJECT_BUILDING_MESH_ROUGH.

The actual visibility range is randomly distributed from /sim/static-lod/rough to twice /sim/static-lod/rough, to reduce apparent "popping".

/sim/rendering/static-lod/bare 21000 m Only terrain after this point

AI/MP ranges

Note  For a while now FG supports size based LOD - this is the size of the model on screen in pixels and can be configured in the static lod dialog. All models should have an assigned fallback model; this is a low detail model that can be used for models that are further away.[1]

AI/MP models (other models that aren't being flown/operated by the user) have two models. The first of these is the low detail (or fallback) model, which can be defined by an model developer (sim/model/fallback-model-index) as one of the values in $FGData/AI/Aircraft/fallback_models.xml. When there is no fallback model defined for a model the blue-yellow glider will be used.

AI/MP ranges can either bet set as pixels of the object on screen, or distance from the viewer in meters. This is controlled by the /sim/rendering/static-lod/aimp-range-mode-distance property.

Property Default Description
/sim/rendering/static-lod/aimp-range-mode-distance false Configures the range mode:
  • If set to false the values of /sim/rendering/static-lod/aimp-detailed and /sim/rendering/static-lod/aimp-bare are pixels on the screen. This is default.
  • If set to true, the values are distance from the camera in meters.
/sim/rendering/static-lod/aimp-detailed 400 px This property works differently depending on the range mode.
  • In pixel mode it is the size (in pixels) of the object on screen. When greater than this amount of pixels the detailed model will be used
  • In range mode it is the distance from the viewpoint, when within this range the detailed model will be used.
/sim/rendering/static-lod/aimp-bare 0 px This property works differently depending on the range mode.
  • In pixel mode it is the minimum size (in pixels) of the object on screen.
    • If the object is below /sim/rendering/static-lod/aimp-bare pixels in size, it will not be displayed.
    • When the number of pixels is between /sim/rendering/static-lod/aimp-bare and /sim/rendering/static-lod/aimp-detailed, the low detail (fallback) model will be used.
  • In range mode it is the distance beyond the /sim/rendering/static-lod/aimp-detailed value, at which the low detail model will be used. I.e. the low detail model will be used in the range from /sim/rendering/static-lod/aimp-detailed to (/sim/rendering/static-lod/aimp-detailed + /sim/rendering/static-lod/aimp-bare) .
/sim/rendering/static-lod/aimp-interior 200m Range at which to display the model interior (when the model has a mesh defined as being the interior).

Related content

Wiki articles

Forum topics

Source code