Level of Detail objects are used to improve the rendering performance of objects located far away from the camera picture plane.
Example for linked LOD's:
Additionally, you can make the LOD names more specific by adding a space/underscore and a descriptive name after the "$lod1"; i.e. "$lod1 box", "lod2 box".
Naming them specifically can help locating problematic assets which may be highlighted by the Resource Compiler during the build process. So long as the node begins with $lod<number>, the rest of the name shouldn't matter.
In the Schematic View mode of 3ds Max it will look like:
LOD's can also be created for and linked to sub-objects of complex assets, i.e. breakable objects, cars, tanks.
The engine will automatically detect the correct LOD step for the sub-objects based on distance/size/triangle count of the object.
Example of LOD's for sub-objects:
When linked correctly, the LOD's do not need to be added to the list window of the exporter.
"Merge all Nodes" needs to be unchecked in the exporter settings.
Kept for backwards compatibility - You can also create a separate .cgf object with the same object name plus the post fix _lod1, _lod2, etc.
The engine will automatically use these external LOD's. But this method is not recommended and might be removed in future releases.
Examples:
1. Create a group called 'cryexportnode_@' replacing the '@' with the filename to export to.
2. Group the highest detail mesh (lod0) under a new group named '#_group' replacing the '#' with the name of the model you are exporting.
3. Group the '#_group' for LOD0 under the 'cryexportnode'.
4. For each additional LOD level create a group using the naming convention in step 5.
5. Make sure the LODs are using the following naming convention 'lod#@_group' replacing the '@' with the mesh name of your choice, replace the # with the lod ID. Ensure the same for all the LOD levels eg _lod1_mayalod_group, _lod2_mayalod_group.
6. Group the geometry for each LOD under the nodes we created in step 4.
7. Select the 'cryexportnode' group.
8. Click the export button on the 'Crytek' toolbar to open the 'Crytek Export' dialog.
9. Click the 'Add Attributes' button.
10. Ensure that 'Do Not Merge Nodes' is ticked.
11. Click the 'Export' button on the 'Crytek Export' dialog.
An example Maya scene for setting up LODing geometry can be downloaded lodtest.mb.
There is no special setup needed. The engine will automatically detect LOD's and use them if available.
There are various console commands which help debugging LOD's in Sandbox of in game mode.
e_Lods
Load and use LOD models for static geometry
e_LodMin
Min LOD for objects
e_LodMax
Max LOD for objects
e_DebugDraw
Draw helpers with information for each object (same number negative hides the text)
1: Name of the used cgf, polycount, used LOD
2: Color coded polygon count
3: Show color coded LODs count, flashing color indicates no Lod
4: Display object texture memory usage
5: Display color coded number of render materials
6: Display ambient color
7: Display tri count, number of render materials, texture memory
8: RenderWorld statistics (with view cones)
9: RenderWorld statistics (with view cones without lights)
10: Render geometry with simple lines and triangles
11: Render occlusion geometry additionally
12: Render occlusion geometry without render geometry
13: Display occlusion amount (used during AO computations). Warning: can take a long time to calculate, depending on level size!
15: Display helpers
16: Display debug gun
17: Streaming info (buffer sizes)
18: Streaming info (required streaming speed)
19: Physics proxy triangle count
20: Display object instant texture memory usage
21: Display animated object distance to camera
22: Display object's current LOD vertex count