S&box Wiki



LODs are variant meshes that often have lesser geometry than its derived original. When a model with high-quality meshes is viewed from far away, it can be swapped for an LOD-group of itself with lower quality meshes to improve performance, while the player would see no respectable difference.

Similarly, it is also common for textures to be vested with mipmaps that interchange based on the distance away from the material surface.

Preparing LODs

LODs are easiest to make when derived directly from the original model of highest fidelity. The mileage for creating LODs will vary based on your modelling software.

A common practice is to make a copy of the original geometry and thereafter decimate it, which instructs the software to reduce the amount of vertices that the geometry consists of, while simultaneously compromising for as much of its original shape as possible. There may be other methods of simplifying a mesh convincingly at a distance and different software may offer differing tools towards doing so.

Once this has been done for the first iteration of an LOD, you can repeat the procedure above with stronger and stronger decimation over time, making sure that the geometry count decreases over each time. Every iteration is made part of a new LOD group that can be set further and further away from the original model. It may look unimpressive after a few iterations, but from far away it will be nearly impossible to tell.


You can also set up LODs to exclude smaller separable parts of the model that would never be visible from a long distance away, if decimating the geometry further is no longer viable.

Moving into ModelDoc

Import the meshes of your model, including their LODs, into the ModelDoc node tree. It is generally a good idea to also associate all of your meshes and LODs with a default, or several bodygroups of your choice. This can also be automated by selecting the meshes in the node tree and right clicking:


Once the meshes, and their LOD counterparts, are bodygrouped accordingly, it is time to add LODGroups in ModelDoc:


LODGroup simply refers to a single LOD group, so add or duplicate as many as you need. LODGroupAll is a unique group that contains meshes that should always be displayed, no matter the distance. This is useful for parts of the model that do not have LODs made for them, and thus should always be visible all the same at any distance.

The first LODGroup that is added is always referred to as LOD 0 by default, and it always has a visibility threshold of 0. This group is also where you should only designate the original model, and no LODs.

Meshes that are never included into any LODGroup will also never be visible!

LODGroups are sorted in the tree, according to their switch threshold. This threshold can be edited in each LODGroup node. It is a measurement of distance that dictates at whichever distance away that the model should interchange into the LODGroup in question. This distance can also be snapshotted directly within the ModelDoc viewport, via a button at the top of the node's property list:

The slider of the switch threshold, at the top of the node editor, is clamped to values between 0 and 50. Any higher value input into the adjacent box will get clamped down. The workaround to this is to use the property input at the bottom, instead of the slider at the top. Their functionality is seemingly identical, but you may not be able to use snapshots of the viewport at longer distances.

The groups will be named accordingly, but to quickly add the corresponding meshes into each one, you can refer to the previous context menu and use the same automation technique. All second-rate LODs correspond to group LOD 2 and so on:


Part name → LODGroup
part.dmx LOD 0
part_lod.dmx LOD 1
part_lod2.dmx LOD 2
... ...


Once the meshes and their LODs are distributed and the LODGroups are given switch thresholds, the model can be compiled and you can immediately test the LOD functionality. Either via the Compiled Preview Outliner or via the LOD box on the upper bar.


You can also toggle Rendering Info in the viewport to get instantaneous feedback on the currently active LOD group.