LOD Container (Legacy)
- Last UpdatedApr 02, 2025
- 3 minute read
Graphics Level of Detail
-
An LOD Container is an LOD system (LevelOfDetail) that can contain different types of objects in the same LOD.
-
Supports: Groups, Dummy, Mesh, BillboardGroup.
Definition
-
An LODContainer is defined in 3DSMax using a Dummy.
-
The position of the Dummy must be well studied since the calculation of the LOD to be rendered is done on the distance between the Camera and the position of the Dummy.
-
The size of the Dummy is not important now, but it would be smart to have all the objects it represents.
-
The objects that compose the various LODs must be defined inside the Dummy UserBuffer.
Notes and Limitations
-
The main Dummy must not be in hierarchy with anything.
-
All the Mesh / Dummy / Groups indicated in the LOD must be present in the same fle Max and exported together
-
'name *' works only for szMesh and szHierarchy.
-
It is not possible to use the same mesh (or axialgroup) several times in the same Dummy.
-
In practice, every element inserted in the $ LSSS_EEE structures can be inserted only once.
-
The value of the distance between the camera and the center of the LOD is not the mathematical distance between these two points, but it is the projection of this vector on the axis of vision of the Camera.
Code example
This is a code example for LODContainer.
$LODContainer
{
iVersion = 1
$L0_300
{
szMesh = TeapotHI
szBillboardGroup = Alberi01
}
$L300_999
{
szMesh = TeapotLO
}
}
Structure
Each LOD consists of this structure.
$LSSS_EEE
{
}
Notes about structure:
-
SSS and EEE indicates the range of distances within which this LOD is visible (Start and End).
For example, a definition of $ L0_300 indicates a visible LOD from a distance of 0 to one of 299.9999999
-
The next LOD then could be defined by $ L300_999.
-
It is, in theory, possible to leave holes between one LOD and another (for example $ L0_300 and $ L500_600).
-
The last LOD should have enough value to be seen from the farthest chamber, unless you want to make it disappear when the distance from the camera becomes too much.
Parameters
Each LOD structure contains the elements that will compose that LOD.
szMesh
-
szMesh = meshname
-
Meshname is the name of the mesh.
-
Use the * character at the bottom of the name to include all the meshes that start with that given name,
For example szMesh = MeshCasaHI * would include all the meshes whose name starts with .
szHierarchy
-
szHierarchy = hiername
-
Hiername is the name of a Mesh / Dummy / Group.
-
The szHierarchy command includes all the mesh hierarchy that are under the hiername object. The recursion is cyclical, that is, it does not stop at the children of hiername but continues also for the children of the children, and so on.
-
Use the * character at the bottom of the name to apply this procedure to all the nodes that start with that given name,
For example szHierarchy = GroupCasaHI * would include all the meshes that are below in hierarchy to all the Mesh / Dummy / Groups whose name starts with GroupCasaHI.
-
The behavior is slightly different from the previous one in meshname. Here, we do not include all the meshes starting with name *, but instead we take into account all the Mesh / Dummy / Groups that start by name, and starting from these it goes down hierarchically adding all the meshes in the hierarchy.
szAxialGroup
-
szAxialGroup = axialname
-
Axialname is the name of the AxisGroup to be included in the LOD.
szBillboardGroup
-
szBillboardGroup = groupname
-
Groupname is the name of the BillboardGroup to be included in the LOD.