SCENERY LODs
NOTE: Due to the addition of SimPropContainers to the simulation, this page is only relevant to the legacy method of modelling scenery, ie: large-scale modelling.
In order to ensure optimal performance in Microsoft Flight Simulator 2024 for the models created for your add-ons (scenery, airports, aircraft, etc..) it is important to have a series of LODs created for each model. This is because levels of detail will be loaded into memory only when necessary, ie: only the data necessary to display a model will be loaded into memory at any time. To make sure this actually functions as designed by optimising performance, it is important that lower resolution LODs use less memory. Note though that the sum of the LODs in memory can still be relevant if an object is instantiated multiple times all around the player. In that case, multiple (or even all) LODs may be loaded and displayed at the same time, thus exist in memory at the same time, making optimising everything of paramount importance.
It should be noted that if you are in possession of a licensed copy of the Simplygon SDK, then you can make use of the Microsoft Flight Simulator 2024 AutoLod feature for scenery instead of following the recommendations here. For more information, please see:
LOD Files
LOD files are stored as separate glTF files (one for each LOD) in the Models folder for the package. They are then referenced from the <model_filename>.xml
using the <LODS>
element. You can find an example of how to set this up here:
The most general rules of thumb for creating LODs - given the constraints that every LOD should reduce all Optimization Recommendations - would be:
- On each LOD, the number of vertices/faces should be around 50% of the previous LOD
- On each LOD, the number of materials used should be around 50% of the previous LOD
- On each LOD, the total texture memory (number of texels) used should be around 50% of the previous LOD
General Recommendations
The following are some general recommendations that should be considered when creating model assets:
- We suggest that you create at least 4 LODs.
- In general, we recommend tweaking your LODS in the "high" quality setting, which is neutral for LOD selection (meaning a LOD with 50% "minSize" will switch at 50% size on screen), and reduces the quality of only some textures.
- You should try and share textures between different models and model LODs.
- Remove textures you may not need at a distance, such as a normal map, and try very hard to avoid creating extra textures at a smaller resolution, this will just increase total memory usage. Prefer simply removing textures whenever possible.
- Use appropriate texture resolutions for your textures. It is usually not necessary that all textures in a material have the same resolution.
- Use metallic/roughness/… material settings instead of textures when possible.
- Every LOD should further reduce most - if not all - of its Optimization Recommendations if possible. The main considerations are texture memory used, the number of faces, and the number of draw calls. Typically, the number of vertices is at least halved with every LOD.
- Minimize skinned mesh usage. In Microsoft Flight Simulator 2024, compared to regular objects, they consume a significant amount of CPU and memory, so use them only if mesh deformation is necessary. Skinning can often be avoided on lower resolution LODs. Also note that when a skinned mesh is moved with bones that are somewhere else completely in the hierarchy, you can have an issue where the skinned mesh disappears when looking at it because the bounding box used for camera frustum culling is in a completely different location from the vertices. To avoid this, make sure that the skinned mesh node itself is part of the hierarchy, such that the bounding box moves with it whenever possible.
- To make sure the last LOD is useful, the second-to-last LOD should have a "minSize" of at least 1%, but preferably be higher.
- The last LOD should have approximately 100 triangles, 1 material and no textures. Also note that:
- Since there are many objects far away, reducing them to one draw call is important.
- Its "minSize" property is ignored, it is always set to zero.
- If you do need a partially emissive or metallic last LOD, consider using a very small texture rather than creating a second material.
- You are not forced to keep the same node/instance structure in all LODs.
- Reducing the number of vertices and draw call on each LOD will bring you to a point where the instances could be merged together, and - if possible - they should be.
- Low poly LODs often do not need a texture at all, and you can simply use the vertex color (this is essentially a "free" way to color a model because of the single-vertex format.
- Prefer low-resolution textures for LODs below the approximate 5% "minSize", eg: try to keep this as 64x64px or smaller.
- If a model has lights, all its LODs will also need lights, otherwise you will see the lights "pop" into the scene as the LOD changes.
- All scenery model LODs, with the exception of objects that aren't important for collision, need colliders. You should prefer using the collision shapes - rectangle, cylinder, sphere - over collidable materials. This is explained in more detail here: Collision Handling
Instancing And Flattening
One feature of creating a model as efficiently as possible is the use of instances to create "clone" objects within the model that will be rendered as a single batch and also be stored as a single object in memory, reducing the GPU overhead required to render it in the game. This sounds great, but comes with a trade-off as each instanced object will require it's own node in the model hierarchy, which in turn will require additional CPU processing. So, when dealing with different LODs, it is often worthwhile using instances on LOD0 and LOD1, but then flattening the model for the higher LODs. Flattening the model will greatly reduce the node count and combine everything into a single mesh, which may be more appropriate and give better performance at higher LODs.
Airport And Scenery LODs
An airport can contain many models, and as such it is effective to group several objects together, to try and reduce the number of draw calls - especially when you take the Xbox target into consideration as it requires highly optimised assets. However - depending on the location - this shouldn't be done for very large areas and/or very high-poly meshes, as you will then not fully benefit from LOD and camera frustum culling when closer to the object.
NOTE: LODs can be debugged from the Debug LODs window, available from the DevMode Options. It will show various overlays to help debug the different LOD levels for the objects in a scene, and can also be used to force LOD levels to permit you to see them in the simulation.
Below we show an example of an airport as it goes through the different LOD levels. Note that the first LOD has very detailed geometry with multiple textures, then we decrease the face count after LOD0 and remove textures, replacing them with vertex color. After LOD3, the textures are duplicated and reduced to 64*64px.
LOD0
- minSize 150%
- 8632 faces
- approx. 15 materials
LOD1
- minSize 60%
- 3712 faces
- approx. 12 materials
LOD2
- minSize 15%
- 2063 faces
- 2 materials
LOD3
- minSize 7%
- 699 faces
- 1 material
LOD4
- minSize 3%
- 319 faces
- 1 material
LOD5
- minSize 1%
- 113 faces
- 1 material
LOD Animation
If you have any animated scenery elements it should be noted that the Microsoft Flight Simulator 2024 engine will perform some optimisations on them based on their size on screen and distance from the camera. What this means is that:
- As objects get further from the camera, animations will begin to "frame skip" and instead of updating every frame, they will update every N number of frames (the exact value depends on the distance). So, a 100 frame animation may play 1 animation frame every simulation frame up close, but then play 1 animation frame every five simulation frames when far away (frames are interpolated so it would play frames 1, 5, 10, 15, etc...).
- When the object is considered as less than 1% of the screens size then the animation will not be shown and the object will appear static.
The values used for these optimisation are based on the bounding sphere of the object which is calculated automatically by the engine based on the object mesh.
Now, for most objects this is fine and not really an issue, but if you have a large object with obvious animations then it can become problematic. To resolve this, we suggest that when making the object mesh you add an "invisible" box or sphere mesh to the object that is much larger than the object itself and export the object with this invisible mesh (for all LODs). The Microsoft Flight Simulator 2024 engine will then use this invisible part of the mesh to calculate the bounding sphere, meaning that the animation optimisations will not be applied until the object is much further from the camera.