How is LOD implemented?

Hello,

So I have reached the point where I want to have lots of Zombies coming at the player, however I seem to get some frustrating lag. I have used Occlusion Culling as well, but it’s having a bit of issues right now such as even when the zombie is still in the camera, it sometimes flickers.

So I read about ‘LOD’, Level Of Detail which got me interested. I basically wanted it to work like the system of SpeedTree as for when you are far from the Tree, the LOD is at the lowest, and as you get closer, it increases and eventually reaches max.

Will I need to do lots of scripting for this? If that’s the case, don’t write me up a whole script, just get me on the go to making this awesome system for my Zombies. :slight_smile:

Hi Dimitri,

you have multiple options. First, unity comes with an integrated LOD system. You can find this under Components->Rendering->LOD Group. Add this to your Game Object. Now you have to generate a 3D object file, e.g. an .fbx file with multiple meshes and name them …LOD0 …LOD1 …LOD2. Generate a Mesh or Skinned Mesh Renderer and assign this 3D object and it should switch beteen the LOD’s depending on distance.
The problem with Unity’s LOD system is, that it might be slow, because it has to calculate the distance between every LOD Group and the camera very often. A better choice is to make a 3D Grid, that holds each object and updates rarely. For this the best LOD system on the asset store is in my opinion QuickLod together with InstantOC. They are worth the money.

Sincerly,

Andre

No, no scripting needed. You just have to add the “LOD Group” component to your zombie model.

It would be nice if you have different versions of your zombies, one for each LOD level, like a super detailed one for close view, a medium detailed and a low detail (for far view).

More info here: Unity - Manual: LOD Group

So I will be answering my own question with some knowledge from ‘TutiBueno2’ as well.

In order to work with an effective LOD system which will allow you to have many objects in your world, or if you are building a huge open world level, then using the LOD system is for you.

Here is a short tutorial:

  1. First, you will need your model, but several of them each with lower poly meshes.
  2. You will click on your Parent Object/ZombieAI >> Add Component >> Rendering >> LOD Group.
  3. You will now have:
  4. LOD 0 (Highest Polygon Model) - Click on the Green LOD0 100%, and you will see you can add Renderers. Drag your highest detailed mesh/model in to that Renderer.
  5. LOD 1 (Medium Polygon Model) - Drag your lower poly model’s render parts in to that as well.
  6. LOD 2 (Lowest Polygon Model) - Drag the lowest poly of the model in to LOD 2.
  7. Change your ‘Fade Mode’ to Crossfade and you can configure how far and close it should begin to render, etc.

BE AWARE, if you only have 1 model such as a model from Mixamo’s ‘Fuse’, then you may have trouble unless you use there Decimator which lowers the polys of the model.

Since Mixamo have just joined Adobe, the decimator is currently not usable and all features should be restored within a few months according to Mixamo.


If you are NOT using a Third Party program to create your models and would like to use an LOD system, it is recommended that when you are creating your 3D models, you should start with making the lowest poly model up until the highest, or as I heard some sort of unwrapping method can help.

I really hope this helps for anyone else in the future wanting to know about how the LOD system works.