Display

core.display.set_lod_threshold

Client

Sets the global LOD threshold used when rendering models

Syntax

local status = core.display.set_lod_threshold(
    threshold
)

The threshold is global and combines with each component's LOD bias.

  • Effective detail — roughly bias / threshold, so a higher threshold uses less detailed LODs.
  • Zero — 0 disables automatic LOD, so the highest detail is always used.
  • Negative values — clamped to 0.
  • Per component — see self:set_component_lod_bias for a single component.
  • Local only — a render setting on this client, never replicated to other peers.

Parameters

TypeNameDescription
floatthresholdLOD threshold to apply, negative values are clamped to 0

Returns

TypeNameDescription
boolstatustrue on successful execution, false otherwise

Examples

Use less detailed LODs to improve performance
core.display.set_lod_threshold(2)
Set the threshold and read it back
core.display.set_lod_threshold(2)

core.engine.print("info", "LOD threshold:", core.display.get_lod_threshold())

On this page