Most of the work to make a functional LOD object is completed using 3d modeling software. An LOD object comprises multiple versions of the same object. Each version is less detailed and has fewer polygons than the previous version, while retaining the model’s silhouette. The goal is to make sure each model is detailed enough for the size at which it will be seen on screen.
It is common practice to assign a relevant name to each object depending on its order in the group. I like to name them by the screen height percentage I will assign to them inside of Stingray, but a more flexible nomenclature can easily be adopted (LOD0, LOD1, LOD2, etc.).
All the different objects need to be placed at the same geographic location. We don’t want the object to move left or right as we distance ourselves from it.
Once models respecting these simple guidelines are exported from the modelling software together, they can be imported as one file inside Stingray. From that point, it is easy to create an LOD object inside the game engine.
Even though the objects in the group are specifically modeled to act as part of an LOD object, there is no way for the engine to determine that on its own. Once imported and placed in a scene, the unit will render all of the models simultaneously. To prevent that from happening, parameters called LOD steps must be set within the LOD object. The steps determine which object will be rendered at the specified screen height percentage.
In Stingray’s Unit Editor, there is a panel dedicated to Level of Detail objects. Once one of the models is selected, a new LOD is created by clicking New LOD Object. Next, LOD Steps must be assigned.
Using the New LOD Step button allows you to assign a step to every object in the unit. Together, the ranges should cover every possible size the unit can have on screen, ranging from 0% to 100% of the screen height.
With the LOD steps in place, the unit now
knows how to behave as an LOD object; it can finally be placed in a scene. If
done properly, the transitions between the different versions of the model shouldn’t
even be noticeable.
Enjoy your optimized assets!