BuildMeshLOD()

Syntax

BuildMeshLOD(#Mesh, NbLOD, Distance.f, ReductionValue.f)
Description
Build automatically one or several level of detail (LOD) for the mesh. The #Mesh will be replaced automatically with less complex mesh when displayed above the specified distance from the camera. If more precise LOD meshes are requiered, AddMeshManualLOD() can be used.

Parameters

Mesh The mesh to use.
NbLOD Number of needed LOD for this mesh.
Distance The minimum distance from the camera where the first LOD mesh will be used instead of #Mesh. For the next LOD meshs, the distance will be calculated using this formula: 'Distance / SqrF(1-ReductionValue)'.
ReductionValue The reduction to apply, between 0 (no reduction) and 1 (100% reduction).

Example: CreateMeshLodLevels(#Mesh, 3, 100, 0.75)
- The first reduction of the original mesh starts from 100 units of the camera, vertices number halved by 4 (75% reduction). - The second reduction of the original mesh starts from 200 units of the camera, vertices number halved by 16. - The third reduction of the original mesh starts from 400 units of the camera, vertices number halved by 64.

Return value

None.

See Also

CreateMesh(), AddMeshManualLOD()

Supported OS

All

<- AddSubMesh() - Mesh Index - BuildMeshShadowVolume() ->