Massive LOD System
This document explains the details of the Massive LOD system in Unreal Engine 3. It also covers some editing topics for how to set it up in the UnrealEd.
The Massive LOD system is a collection of techniques that together make it possible to render wide open vistas while keeping a high framerate. It should be combined with other existing functionality (such as cull distance, StaticMesh LODs, and streaming) to generate levels with Gears of War level of detail up close and much lower level of detail for far away objects.
The goal is to have levels built with an order of magnitude higher number of meshes, while keeping the performance consistent.
One very important new concept introduced with Massive LOD is the contept of LOD Parenting. This is a system where many meshes are efficiently replaced with a single mesh when the objects are sufficiently far away.
Imagine a building that when up close to the player is made out of hundreds of pieces to have a high quality building. When that building is far enough away, it doesn't make sense to use hundreds of draw calls to render that building, when you can't really see much detail anyway. With standard StaticMesh LOD, you may be able to reduce the number of polygons in those hundreds of pieces - but you are still making a lot of draw calls, which slows down the rendering thread and the GPU.
However, with LOD Parenting, the entire group of building pieces can be replaced with a single mesh that looks similar to the super high detail group of meshes.
Furthermore, it supports hierarchical parenting, so you could replace all buildings with single mesh buildings, then you could at a farther distance replace all buildings in a city block with a single mesh for the block.
New Context Menu Options
Where Found: "LOD Operations" submenu in right click menu
How To Use: There are several new menu items that are used to set up the parenting/replacement relationship. In the 100-piece building replaced by a 1-piece building example, you would do the following:
Now, you can see as you move the camera in and out that the pieces will pop in and out, depending on the MassiveLODDistance of the parent. If you Uncheck the LOD Parenting Show Flag in the viewport, you will see both sets of pieces. Also, with that show flag unchecked, if you select a child mesh, you will see a yellow line connecting it to its parent.
You can also clear the replacement parent of a mesh using the "Clear LOD Replacement" option.
- Place the 100-pieces and the 1-piece portions, in the level.
- Select the 1-piece building.
- Go to properties and set the MassiveLODDistance (in Rendering group) at the distance you want to swap to occur
- Right-click, go to LOD Operations, select "Set as Active LOD Parent"
- Now, deselect it and select all 100 pieces of the high detail
- Right-click, go to LOD Operations, select "Use 'XXX' as the LOD Replacement"
LOD View Locking
Where Found: View menu
How To Use: LOD View Locking is a mode (independent of all other modes) in the editor that does two things:
- All views of the same type (perspective, top, side, etc) will all share a camera. So, if you have two perspective views open, and LOD Locking is enabled, when you move the camera in one, it will move it in the other. (The reason for this will be made clear below)
- In Ortho views, culling and LOD parenting (replacing 100 meshes with 1 at a far distance) will use the perspective view's camera location for distance checks (this is because ortho views have no real "camera location").
Per View Group Hiding
Where Found: Hidden Groups submenu of Show Flags menu
How To Use: At the bottom of the Show Flags menu, the Hidden Groups submenu has been added. It will show a list of all known groups (same as in group browser). When a group is chosen in this menu, any actors in that group will be hidden in that view only.
When this is combined with the LOD View Locking, you will more easily be able to set up parenting because normally when two meshes are on top of each other it is hard to select the proper one. Now, you'll be able to make groups for low LOD meshes and high LOD meshes, then only show low in one view and high in the other. Select the active parent in the low LOD view and then assign it in the high LOD view, using the context menus.
LOD Parenting Show Flag
Where Found: "LOD Parenting" in Show Flags menu
How To Use: When the editor starts, all views will have LOD Parenting enabled. This means that LOD parents and MassiveLODDistance will be used to only show high or low LOD. If you disable LOD Parenting, the following will happen:
You would probably want to disable LOD parenting when you are setting up your parenting (using two LOD Locked views, etc, as above). This is so that you can see all meshes, and the MassiveLODDistance of the low LOD actors won't make it difficult to select meshes. (With MassiveLODDistance enabled, you have to be far from the mesh for it to draw, making selection potentially difficult).
- MassiveLODDistance and the LOD parents will be ignored, meaning both sets of meshes will be drawn
- Since both are drawn, selected high detail meshes will draw a line to their LOD parent