<OccluderLods>
<OccluderLod occLodLevel="0" occFaceCount="100" occMaxHausdorffDistance="7" occMaxHausdorffDistanceExtra="9" occMinHorizontalDistance="1" />
<OccluderLod occLodLevel="1" occFaceCount="20" occMaxHausdorffDistance="25" occMaxHausdorffDistanceExtra="30" occMinHorizontalDistance="1" />
</OccluderLods>
So, in this guide, I will go through some of the XML data above using Microsoft Copilot (AI companion). I asked the companion what it could tell me about the code. Here’s the response:
This XML snippet is part of an i3D file that configures how occluder meshes are managed for occlusion culling in Farming Simulator 25. In modern game engines, occlusion culling helps improve performance by not rendering objects or terrain that aren’t visible to the player. Here’s a breakdown of what each part of the code is doing:
The Structure
<OccluderLods>
This is a container element that holds different occluder level-of-detail (LOD) configurations. Each LOD defines a simplified version of the occluder geometry that the game engine can use for quick culling decisions.<OccluderLod>
Each of these elements specifies a particular occluder LOD, and they come with a set of attributes that define how the occluder geometry should be approximated.
The Attributes Explained
occLodLevel
This attribute sets the occluder’s level of detail. A lower level (such as0
) generally means a more detailed occluder, which is used when precision is more important (for example, when objects are near the camera). Higher levels (like1
) mean less detail is required, which is acceptable for objects further away since minor inaccuracies won’t be noticeable.occFaceCount
This parameter defines the number of faces (or triangles) that the occluder mesh will have. For level 0, a count of 100 faces indicates a relatively high-detail approximation. In contrast, level 1’s 20 faces mean a significantly simplified mesh, which is faster to process but less accurate in replicating the original geometry.occMaxHausdorffDistance
The Hausdorff distance is a metric that measures the maximum deviation between the occluder’s simplified shape and the original, more complex geometry. A lower value (7 units for level 0) means the occluder is a closer approximation, ensuring precision in occlusion decisions for nearby objects. For level 1, a higher value (25 units) allows more deviation, which is acceptable when the occluder is used at a greater distance.occMaxHausdorffDistanceExtra
This appears to provide an additional tolerance margin on top of the primary Hausdorff distance. For instance, level 0 allows up to 9 extra units of deviation compared to 7 for the primary value, while level 1 has an extra tolerance of 30 units on top of the base 25. This extra parameter can help in fine-tuning the culling behavior, ensuring that the simplified mesh is “good enough” without being overly strict, especially in complex or varied terrain.occMinHorizontalDistance
This value likely specifies the minimum horizontal distance from which the occluder is considered effective. Setting it to 1 for both levels might ensure that occlusion culling only takes effect when objects are at least 1 unit away horizontally, perhaps to avoid unnecessary culling of very nearby details.
Practical Implications
- Level 0 (
occLodLevel="0"
):
With 100 faces and tighter error bounds (7 and 9), this level is used for occluders where a high degree of precision is necessary. It’s more computationally expensive due to the higher face count but ensures that the occlusion approximation closely matches the original geometry, which is critical for terrain or objects close to the player. - Level 1 (
occLodLevel="1"
):
This level, with only 20 faces and looser error parameters (25 and 30), is suited for distant terrain or objects where the visual difference in occlusion accuracy is less noticeable. The reduced complexity helps save on processing power by using simpler geometry for far-off occlusion tests.
In essence, these settings allow the game engine to have a tiered approach: high-fidelity approximations where needed and more performance-friendly versions when the player is unlikely to notice small deviations. This balance is critical in a game like Farming Simulator 25, where large, open-world scenes need to be both visually appealing and efficiently rendered.
Debugging Occlusion (according to Microsoft Copilot)
Great! Let’s delve deeper into testing LOD (Level of Detail) quality in-game and balancing terrain parameters like lodTextureSize
with others such as patch size and occluder settings.
Testing LOD Quality In-Game
- Enable In-Game Debug Modes:
Farming Simulator 25 provides various in-game debugging tools (note: F5 key on the keyboard in-game). Activating the occlusion culling and LOD visualizers (often through debug keys or console commands) lets you see how terrain and objects transition between LOD levels. Look for visual cues—like changes in texture sharpness or the appearance of simplified meshes—as you move the camera through the scene. - Observation of Transitions:
Walk through your map while closely observing the transitions from high-detail textures to lower-detail ones. Check for any popping artifacts or sudden shifts. Ideally, the switch between LODs should be so seamless that you don’t notice a stark reduction in visual detail as you move away from the camera. - Performance Metrics:
While evaluating, monitor in-game performance using built-in stats or external tools (e.g., MSI Afterburner, FPS counters). This helps you see if increasinglodTextureSize
or tweaking patch size adversely affects frame rates or memory consumption. A higher base texture resolution will demand more video memory, so a balance needs to be struck. - Iterative Testing:
Create variations of your terrain settings and test them in similar scenarios. For example, compare a test map usinglodTextureSize="2048"
with one at a higher value, and note differences in visual quality and performance. By iterating this process, you can pinpoint the settings that best suit your target hardware and the visual style you’re aiming for.
Balancing Terrain Parameters
lodTextureSize
:
- 2048 vs. Larger Sizes: A setting of 2048 means your base LOD texture is 2048×2048 pixels. This is lighter on memory and processing but might not deliver the ultra-crisp detail you’d get with higher resolutions (like 8192). For many maps, 2048 strikes a good balance, ensuring that distant terrain is rendered efficiently while providing adequate detail at closer ranges.
- Visual Consistency: Ensure that the texture’s resolution aligns with the scale of your terrain details. If your map relies on fine details visible to players when they are nearby, you might need a higher resolution setting—bearing in mind any performance trade-offs.
- Patch Size:
- The patch size divides the terrain into smaller chunks. A well-chosen patch size (like the default “5” in Giants Editor) helps in managing how and when these chunks transition between LODs. Smaller patch sizes mean more segments to manage, but they allow for more granular detail control and precise culling. Conversely, larger patches might reduce processing overhead but could lead to less efficient culling in complex terrains.
- When combined with your chosen
lodTextureSize
, the patch size also affects the apparent sharpness of textures and how the game engine blends different LOD levels. Experiment with both parameters to achieve a harmonious balance.
- Occluder Settings:
- Parameters like the
<OccluderLods>
configuration you saw earlier also play an essential role. Accurate occluder meshes ensure that only visible terrain is rendered. Keeping occluder LODs consistent with terrain LODs means that both the texture and the geometry simplifying processes work together to deliver optimal performance and visual quality.
Practical Workflow for Balancing
- Start with Defaults: Use the default settings as a baseline. Observe the in-game performance and visual quality.
- Make Incremental Changes: Adjust one parameter at a time (e.g., first test different
lodTextureSize
values) and note their impact. - Evaluate on Target Systems: If your mod or map is designed for a wide range of hardware, consider testing on both high-end and low-end setups.
- Document & Iterate: Keep track of your changes and corresponding performance metrics. Sometimes even slight tweaks can have significant cumulative impacts on both performance and visual fidelity.
By carefully testing and balancing these parameters, you can ensure that the terrain appears detailed where it needs to be while also running smoothly.
Source: Microsoft Copilot
Visual Debugging
So to my own surprise, when it comes to larger maps like 4km x 4km maps, I thought that the red and yellow triangles on the terrain was indicating a visual error with the terrain itself, mostly due to it’s difference from the typical 2km x 2km vanilla maps in Farming Simulator.
But this is not the case, when I was debugging the vanilla Zielonka map. So below we have a house, where the occluder is visualized with a blue color.

In the next one the occluder is visualized on the terrain, under the water surface as red spots.

If you find that some buildings (that use an occluder object) inside their transform group(s), these occluder objects may clip a bit through the visual mesh, like this one, where we see a dense blue color on the rooftop. The occluder object isn’t accurately aligned with the surrounding mesh object.

I also observed that the terrain occlusion colors appear outside the detailed foliage/vegetation LOD circle, which is the visual circle you see around you, especially when moving around on a map. That noticeable circle is where the foliage LOD is rendered between detailed foliage and not-so-detailed foliage.

Anyway, I hope this guide clarified some things about the occluder LODs that we can find inside the XML code for the map’s main i3D file (ex, map.i3d) and also inside the Attributes panel if we select ‘terrain’ from the Scene Graph panel in GIANTS Editor.