LFS Editor/Guides/Vehicle Mod level of detail (LOD) and Shadow - Physics - Collision Meshes

From LFS Manual
< LFS Editor‎ | Guides
Revision as of 21:25, 20 April 2023 by Flame CZE (talk | contribs) (Created page with "When you first start work on a vehicle mod, you can test it in LFS with only a single level of detail. That is the main graphical LOD, known as LOD1. But your...")
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to navigationJump to search

When you first start work on a vehicle mod, you can test it in LFS with only a single level of detail. That is the main graphical LOD, known as LOD1. But your mod cannot be uploaded to the website like that. It needs at least a physics or collision mesh, and finished mods should usually have a shadow mesh too.

Levels of detail

Levels of detail are used to save the graphics card from doing a lot of wasted work when models are far away. For instance, when a model appears only a few pixels across, we do not need to draw that model using thousands of triangles. So levels of detail are important to keep a high frame rate when there are a lot of vehicles in the view.

  • LOD1 is drawn when the viewpoint is near to the model
  • LOD2 is drawn in the middle distance
  • LOD3 is drawn in the far distance

In Live for Speed, LOD2 and LOD3 are not only for graphical level of detail, but also double up as shadow and collision meshes.

There are two possible LOD choices for a mod you upload to the website.

Work in progress / unfinished / test mod - 2 levels of detail

LOD1: Detailed mesh, for close up views
LOD2: Middle distance, shadow mesh and collision box

In this case, the collision mesh doubles as the shadow casting mesh. For most models this approximation is too crude, because the collision mesh is very limited in the number of points and triangles. But it's fine for early testing.

Completed mods usually have 3 levels of detail

LOD1: Detailed mesh, for close up views
LOD2: Middle detail mesh, for middle distance - also used for soft shadow
LOD3: Low detail mesh, for distant views - also used for collision box

In this case, LOD2 is drawn when the mod is in the middle distance. This saves the graphics card doing a lot of work drawing detail that you can't see and helps with frame rate. This LOD should be a good representation of the shape of your mod, so it looks good in the distance, and casts a good looking shadow. LOD3 is only used as a visual representation when the mod is very far away. Its main purpose is for collisions with other vehicles or when your mod hits a wall or rolls over.

How to add an automatically created physics / collision mesh

  • In the modeller, click the + button to the right of lod1 (near the top left) to add a new LOD
  • Now select lod2 or lod3 (the newly created, empty LOD)
  • Click auto-create collision mesh

The automatically created collision mesh is created based on the size of the existing LOD1 (high detail) mesh. This should provide basic collision physics but you will probably want to improve the shape to make it a better match for your vehicle.

Assigning Multiple Configurations To LOD2

When having 2 or more configurations on your model, you might want to make sure that the shadows will correctly cast the shape of the selected configuration, that's when Configurable LOD2 comes in handy..

When you have done a simplified shape of the configuration that you are happy with, select its traingles and a click on + to lod2 button This will now be your LOD2 of that configuration and by doing so, the ingame shadow will cast a proper shape of each different configuration. Make sure that the configuration triangles in lod2 share the same layer with the main one in lod1

LOD3 (lod3) (Collision Mesh) Can Not be Modified for different Configurations yet, it's unified for the whole model.