Level of detail

From Valve Developer Community
Jump to: navigation, search

LODs are important.

Automating the process

Using software automation to reduce polygon count in a model can greatly speed up the process, but results will vary. Making beautiful models with lower levels of detail might require manual tweaking. There may be some tools out there that do it right, however the following focuses on the "old fashioned" approach.

The following image is an example of a relatively bad LOD. This mesh was calculated automatically using a modeling package. It only took one button press.

Sad crumpled up LOD. Half the faces, one tenth the awesome. Not good.


Lod 001.jpg


Sharing vertices

When we create LODs we try to keep some things consistent between the parent and children geometry. These things are: Vertex Positions, Normals, UVs, Weighting, and Tangents.

If those things are shared between an object and it’s child – then the memory footprint is lower. That’s good.

The following is an easy example of this, and then a method for applying this to the Sniper Rifle model above.


Lod 002.jpg


Notice how none of the LOD have vertices that don’t match the predecessors? That’s because only edges and vertices were removed from the model. The edges weren't collapsed, and UVs were left on the perimeter of a UV shell.

The normals were also preserved because the edges were locked. This is the equivalent of not recreating smoothing groups or changing face/vert normals. Different applications handle this wildly differently, but it’s all the same in the end – it's vital to maintain the normals.

From a parent to an LOD, these elements almost never match up perfectly. That’s ok. But they need to match as close as possible to keep the object cheap.

We understand that collapsing edges is sometimes better for the shape. It’s fine to do that when you need to preserve the integrity of the object. When we collapse edges, the models vertices won’t line up and thus will add memory. It's important to be conservative and thoughtful about one's choices.


How many LODs should be created?

It's good practice to half the object's complexity for each iteration. The larger the initial object, the more LODs we want (or perhaps just the higher the reduction in each LOD).

Hats or Miscs are fine with one or two.

Weapons or high poly hats/miscs should have two or three.

On average, a good place to stop is around 500 triangles.

It's important to create LODs after a model is done. Any major changes on the higher level should be reflected in the lower LODs, so it's best to complete the geometry before doing the LODs.