Level Of Detail – Arma Reforger
Lou Montana (talk | contribs) m (Fix dev → diag menu) |
Lou Montana (talk | contribs) (Remove WIP) |
||
Line 2: | Line 2: | ||
== Basics == | == Basics == | ||
'''L'''evel '''O'''f '''D'''etail ('''LOD''') in words one LOD or more LODs ('''LOD0, LOD1 - LODn''') are versions of a '''model with specific triangle and shader complexity'''. The lower the LOD number is the better the quality/higher complexity is. LOD0 stands for the nicest and most performance heavy one. Then the higher the number, the less complex and often also worse looking the model is. | '''L'''evel '''O'''f '''D'''etail ('''LOD''') in words one LOD or more LODs ('''LOD0, LOD1 - LODn''') are versions of a '''model with specific triangle and shader complexity'''. | ||
The lower the LOD number is the better the quality/higher complexity is. LOD0 stands for the nicest and most performance heavy one. Then the higher the number, the less complex and often also worse looking the model is. | |||
These performance cheaper model variants (all but LOD0) are to be rendered generally at higher distances in order to save performance on GPU | These performance-cheaper model variants (all but LOD0) are to be rendered generally at higher distances in order to save performance on the GPU. | ||
The closer the LODs are rendered, the more GPU performance it saves. A user who will set lower quality in '''Settings/Video/Model geometric detail''' in the game's options will get closer switching to worse LODs to save more performance. | |||
How to set which model part will be part of which LOD is described elsewhere (FBX import), but generally put the {{hl|_LODn}} suffix into object name inside FBX. | How to set which model part will be part of which LOD is described elsewhere (FBX import), but generally put the {{hl|_LODn}} suffix into object name inside FBX. | ||
Line 11: | Line 13: | ||
== Preview == | == Preview == | ||
How each LOD is looking, what materials they have and how much triangles or vertices they have can be directly checked in Workbench. Just find desired XOB model in the Resource Browser and double-click on it. Then check Details tab on right part of the viewport and open sub-tab | How each LOD is looking, what materials they have and how much triangles or vertices they have can be directly checked in Workbench. Just find the desired XOB model in the Resource Browser and double-click on it. | ||
Then check the Details tab on the right part of the viewport and open its LODs sub-tab. Then, if "Force selected LOD to render" is checked, it is possible to scroll through the LODs and actually see them. | |||
[[File:armareforger_levelofdetail-preview.png|400px]] | [[File:armareforger_levelofdetail-preview.png|400px]] | ||
Line 18: | Line 21: | ||
== Debug == | == Debug == | ||
There is a diagnostic tool | There is a diagnostic tool which tells which LOD is currently visible on any visible entity instance in a map in {{Link|Arma Reforger:World editor|World editor}}. | ||
Turn it on with the {{Link|Arma Reforger:Diag Menu|Diag Menu}} by pressing {{Controls|Alt|Win}} → '''Scene/Colorize objects LODs'''. | |||
Now each LOD except for LOD0 will have color overlay. If no other than LOD0 is present for the object, then it will constantly switch all colors. | |||
{| class="wikitable" | {| class="wikitable" | ||
| no color overlay | | no color overlay | ||
Line 42: | Line 47: | ||
== Automatic System == | == Automatic System == | ||
Why automatic system, when other engines offer manual control of LOD behaviour? | Why an automatic system, when other engines offer manual control of LOD behaviour? | ||
The automatic system is much less prone to human error and always ensures LOD functionality, even though it might not be always ideal. | |||
For these "not ideal" cases there are manual overrides which will be presented later. | |||
The LOD system tries to keep a constant triangle/pixel ratio across the screen. | |||
It is possible to estimate LOD distances considering LOD factors as a multiplier of triangle count that will change the system's behaviour into earlier/further LODing distance. | |||
=== LOD0 - LOD1 === | === LOD0 - LOD1 === | ||
Line 48: | Line 58: | ||
When the model switches from LOD0 to LOD1 (generally begins to switch LODs) depends on several parameters: | When the model switches from LOD0 to LOD1 (generally begins to switch LODs) depends on several parameters: | ||
* Spherical size of the object - the larger the object is, the further away it starts to switch to worse LODs | * Spherical size of the object - the larger the object is, the further away it starts to switch to worse LODs[[File:armareforger_levelofdetail-boundingsphere.jpg|200px|right]]{{Clear}} | ||
* Triangle count of LOD0 - the more triangles the closer it starts to switch to LOD1 | * Triangle count of LOD0 - the more triangles the closer it starts to switch to LOD1[[File:armareforger_levelofdetail-trianglecount.png|200px|right]]{{Clear}} | ||
* Field of View (FOV) - the larger FOV the closer it starts to switch to worse LODs | * Field of View (FOV) - the larger FOV the closer it starts to switch to worse LODs[[File:armareforger_levelofdetail-fov.png|500px|right]]{{Clear}} | ||
* Graphic settings - "Model geometric detail" on Ultra results in switching to worse LODs further away, Lowest vice-versa | * Graphic settings - "Model geometric detail" on Ultra results in switching to worse LODs further away, Lowest vice-versa[[File:armareforger_levelofdetail-model-geometric-detail.png|500px|right]]{{Clear}} | ||
{{ | |||
=== LOD1 - LOD2 - LOD3+ === | === LOD1 - LOD2 - LOD3+ === | ||
When model starts to switch from LOD1 to LOD2, LOD2 to LOD3 and so on depends on 2 things: | When the model starts to switch from LOD1 to LOD2, LOD2 to LOD3 and so on depends on 2 things: | ||
* | * When the spherical surface size of current loaded LOD on monitor screen reached '''half size against the original screen surface size''' when the current LOD appeared on the screen, then +/- at that moment it switches to next LOD and so on. +/- because it also depends also on the second thing: | ||
* | * The second thing is relative '''triangle count between LODs'''. When each LOD have exactly '''half triangle count of the previous one''', then the first rule based on surface size apply exactly. <!-- | ||
-->When the relative triangle count is not done more or less by half, then it might switch a lot sooner than later.<br>[[File:armareforger_levelofdetail-lod-1-2-3.png|300px]]<br><!-- | |||
-->Sometimes the LODs are not switching exactly ideally and to fix or adjust it there are manual overrides. | |||
Line 69: | Line 77: | ||
The "triangle count" parameter, which heavily influence how fast or slowly prefab is LODing, can be overridden with '''"LOD Factors"'''. | The "triangle count" parameter, which heavily influence how fast or slowly prefab is LODing, can be overridden with '''"LOD Factors"'''. | ||
Yet it multiplies it only for the LOD switching | Yet it multiplies it only for the LOD switching behaviour and it is not really increasing/decreasing number of triangles in the model. | ||
By setting it, it just forces the specific LOD to remain in the scene for shorter (more triangles) or longer (less triangles) distance from the camera until it switches to the next LOD. | |||
The parameter can be found in '''Entity/Mesh object component/LOD Factors'''.<br>[[File:armareforger_levelofdetail-meshobject.png]] | The parameter can be found in '''Entity/Mesh object component/LOD Factors'''.<br>[[File:armareforger_levelofdetail-meshobject.png]] | ||
There needs to have as many "LOD Factors" as there are LODs in XOB model, which are inserted in Mesh object component, in order to influence all the LODs. The good news is that the number of factor fills in automatically based on the number of LODs in the inserted XOB model. Each factor corresponds with respective LOD, so factor 3 influence LOD3 and so on. When there | There needs to have as many "LOD Factors" as there are LODs in XOB model, which are inserted in Mesh object component, in order to influence all the LODs. | ||
The good news is that the number of factor fills in automatically based on the number of LODs in the inserted XOB model. Each factor corresponds with respective LOD, so factor 3 influence LOD3 and so on. | |||
When there are less factors than there are LODs in a model, then these LODs, which do not have their factors assigned, are simply not affected at all... | |||
or they simply behave like if the factors for them were set to 1 - as multiplying by 1 means no change. | |||
[[File:armareforger_levelofdetail-lodfactor.png]] | [[File:armareforger_levelofdetail-lodfactor.png]] | ||
An important note is that '''LOD Factors are inherited from parent prefabs to children prefabs''' as all the other mesh object component parameters. So it is possible to have some factors setup for the "base" or "core" prefab | An important note is that '''LOD Factors are inherited from parent prefabs to children prefabs''' as all the other mesh object component parameters. | ||
So it is possible to have some factors setup for the "base" or "core" prefab which fits most of the prefabs inheriting from it; | |||
yet there is always the possibility to not inherit and to change the factors for any specific prefab/entity in the prefab hierarchy. | |||
=== Save Process === | === Save Process === | ||
Saving of the LOD Factors is done the same way as any other parameters | Saving of the LOD Factors is done the same way as any other parameters saved on entity components. Here is a guide for the saving process just in case: | ||
The LOD factors for specific prefab can be saved by: | The LOD factors for specific prefab can be saved by: | ||
# | # Changing the factor values on "Entity instance" placed in map, applying them to specific inherited prefab by "Apply to prefab" button and then save the world... which saves also all changes in prefabs. <!-- | ||
-->Just be aware that this applies all the | -->Just be aware that this applies all the parameters that you changed on the mesh object component so be sure have not touched anything else on the Entity instance | ||
# | # Selecting specific inherited prefab first (on the Entity instance placed in the world), then changing the factors values and saving the world. | ||
{{GameCategory|armaR|Modding|Guidelines|Assets}} | {{GameCategory|armaR|Modding|Guidelines|Assets}} |
Revision as of 17:05, 15 November 2023
Basics
Level Of Detail (LOD) in words one LOD or more LODs (LOD0, LOD1 - LODn) are versions of a model with specific triangle and shader complexity. The lower the LOD number is the better the quality/higher complexity is. LOD0 stands for the nicest and most performance heavy one. Then the higher the number, the less complex and often also worse looking the model is.
These performance-cheaper model variants (all but LOD0) are to be rendered generally at higher distances in order to save performance on the GPU. The closer the LODs are rendered, the more GPU performance it saves. A user who will set lower quality in Settings/Video/Model geometric detail in the game's options will get closer switching to worse LODs to save more performance.
How to set which model part will be part of which LOD is described elsewhere (FBX import), but generally put the _LODn suffix into object name inside FBX.
Preview
How each LOD is looking, what materials they have and how much triangles or vertices they have can be directly checked in Workbench. Just find the desired XOB model in the Resource Browser and double-click on it. Then check the Details tab on the right part of the viewport and open its LODs sub-tab. Then, if "Force selected LOD to render" is checked, it is possible to scroll through the LODs and actually see them.
Debug
There is a diagnostic tool which tells which LOD is currently visible on any visible entity instance in a map in World editor. Turn it on with the Diag Menu by pressing Alt + ⊞ Win → Scene/Colorize objects LODs. Now each LOD except for LOD0 will have color overlay. If no other than LOD0 is present for the object, then it will constantly switch all colors.
no color overlay | ... | ||||||
LOD0 | LOD1 | LOD2 | LOD3 | LOD4 | LOD5 | LOD6 | ... |
Automatic System
Why an automatic system, when other engines offer manual control of LOD behaviour? The automatic system is much less prone to human error and always ensures LOD functionality, even though it might not be always ideal. For these "not ideal" cases there are manual overrides which will be presented later.
The LOD system tries to keep a constant triangle/pixel ratio across the screen. It is possible to estimate LOD distances considering LOD factors as a multiplier of triangle count that will change the system's behaviour into earlier/further LODing distance.
LOD0 - LOD1
When the model switches from LOD0 to LOD1 (generally begins to switch LODs) depends on several parameters:
- Spherical size of the object - the larger the object is, the further away it starts to switch to worse LODs
- Triangle count of LOD0 - the more triangles the closer it starts to switch to LOD1
- Field of View (FOV) - the larger FOV the closer it starts to switch to worse LODs
- Graphic settings - "Model geometric detail" on Ultra results in switching to worse LODs further away, Lowest vice-versa
LOD1 - LOD2 - LOD3+
When the model starts to switch from LOD1 to LOD2, LOD2 to LOD3 and so on depends on 2 things:
- When the spherical surface size of current loaded LOD on monitor screen reached half size against the original screen surface size when the current LOD appeared on the screen, then +/- at that moment it switches to next LOD and so on. +/- because it also depends also on the second thing:
- The second thing is relative triangle count between LODs. When each LOD have exactly half triangle count of the previous one, then the first rule based on surface size apply exactly. When the relative triangle count is not done more or less by half, then it might switch a lot sooner than later.
Sometimes the LODs are not switching exactly ideally and to fix or adjust it there are manual overrides.
Manual Override
The "triangle count" parameter, which heavily influence how fast or slowly prefab is LODing, can be overridden with "LOD Factors".
Yet it multiplies it only for the LOD switching behaviour and it is not really increasing/decreasing number of triangles in the model. By setting it, it just forces the specific LOD to remain in the scene for shorter (more triangles) or longer (less triangles) distance from the camera until it switches to the next LOD.
The parameter can be found in Entity/Mesh object component/LOD Factors.
There needs to have as many "LOD Factors" as there are LODs in XOB model, which are inserted in Mesh object component, in order to influence all the LODs. The good news is that the number of factor fills in automatically based on the number of LODs in the inserted XOB model. Each factor corresponds with respective LOD, so factor 3 influence LOD3 and so on. When there are less factors than there are LODs in a model, then these LODs, which do not have their factors assigned, are simply not affected at all... or they simply behave like if the factors for them were set to 1 - as multiplying by 1 means no change.
An important note is that LOD Factors are inherited from parent prefabs to children prefabs as all the other mesh object component parameters. So it is possible to have some factors setup for the "base" or "core" prefab which fits most of the prefabs inheriting from it; yet there is always the possibility to not inherit and to change the factors for any specific prefab/entity in the prefab hierarchy.
Save Process
Saving of the LOD Factors is done the same way as any other parameters saved on entity components. Here is a guide for the saving process just in case:
The LOD factors for specific prefab can be saved by:
- Changing the factor values on "Entity instance" placed in map, applying them to specific inherited prefab by "Apply to prefab" button and then save the world... which saves also all changes in prefabs. Just be aware that this applies all the parameters that you changed on the mesh object component so be sure have not touched anything else on the Entity instance
- Selecting specific inherited prefab first (on the Entity instance placed in the world), then changing the factors values and saving the world.