LODManager

Description

Supported Script Types:

  • Interface Scripts
  • Client Entity Scripts
  • Avatar Scripts
The LODManager API manages the Level of Detail displayed in Interface. If the LOD is being automatically adjusted, the LOD is decreased if the measured frame rate is lower than the target FPS, and increased if the measured frame rate is greater than the target FPS.

Properties

Name Type Summary
worldDetailQuality LODManager.WorldDetailQuality

The quality of the rendered world detail.

Setting this value updates the current desktop or HMD target LOD FPS.

lodQualityLevel number

Not used.

Deprecated: This property is deprecated and will be removed.

automaticLODAdjust boolean

true to automatically adjust the LOD, false to manually adjust it.

engineRunTime number

The time spent in the "render" thread to produce the most recent frame, in ms. Read-only.

batchTime number

The time spent in the "present" thread processing the batches of the most recent frame, in ms. Read-only.

presentTime number

The time spent in the "present" thread between the last buffer swap, i.e., the total time to submit the most recent frame, in ms. Read-only.

gpuTime number

The time spent in the GPU executing the most recent frame, in ms. Read-only.

nowRenderTime number

The current, instantaneous time spend to produce frames, in ms. This is the worst of engineRunTime, batchTime, presentTime, and gpuTime. Read-only.

nowRenderFPS number

The current, instantaneous frame rate, in Hz. Read-only.

smoothScale number

The amount of smoothing applied to calculate smoothRenderTime and smoothRenderFPS.

smoothRenderTime number

The average time spend to produce frames, in ms. Read-only.

smoothRenderFPS number

The average frame rate, in Hz. Read-only.

lodTargetFPS number

The target LOD FPS per the current desktop or HMD display mode, capped by the target refresh rate set by the Performance API. Read-only.

lodAngleDeg number

The minimum angular dimension (relative to the camera position) of an entity in order for it to be rendered, in degrees. The angular dimension is calculated as a sphere of radius half the diagonal of the entity's AA box.

pidKp number

Not used.

pidKi number

Not used.

pidKd number

Not used.

pidKv number

Not used.

pidOp number

Not used. Read-only.

pidOi number

Not used. Read-only.

pidOd number

Not used. Read-only.

pidO number

Not used. Read-only.

Methods

Name Return Value Summary
getAutomaticLODAdjust boolean

Gets whether the LOD is being automatically adjusted.

getBoundaryLevelAdjust number

Deprecated: This function is deprecated and will be removed.

getDesktopLODTargetFPS number

Gets the target desktop LOD FPS.

getHMDLODTargetFPS number

Gets the target HMD LOD FPS. The target FPS in HMD mode. The LOD is adjusted to ...

getLODFeedbackText string

Gets a text description of the current level of detail rendered.

getLODTargetFPS number

The target LOD FPS per the current desktop or HMD display mode, capped by the target refresh rate.

getOctreeSizeScale number

Deprecated: This function is deprecated and will be removed. Use the lodAngleDeg property instead.

setAutomaticLODAdjust None

Sets whether the LOD should be automatically adjusted.

setBoundaryLevelAdjust None

Deprecated: This function is deprecated and will be removed.

setDesktopLODTargetFPS None

Sets the target desktop LOD FPS.

setHMDLODTargetFPS None

Sets the target HMD LOD FPS.

setOctreeSizeScale None

Deprecated: This function is deprecated and will be removed. Use the lodAngleDeg property instead.

Signals

Name Summary
autoLODChanged

Triggered when whether or not the LOD is being automatically adjusted changes.

LODDecreased

Not triggered.

Deprecated: This signal is deprecated and will be removed.

LODIncreased

Not triggered.

Deprecated: This signal is deprecated and will be removed.

lodQualityLevelChanged

Triggered when the lodQualityLevel property value changes.

Deprecated: This signal is deprecated and will be removed.

worldDetailQualityChanged

Triggered when the world detail quality changes.

Type Definitions

WorldDetailQuality
Type: number

The world detail quality rendered.

ValueDescription
0Low world detail quality.
1Medium world detail quality.
2High world detail quality.

Method Details

(static) getAutomaticLODAdjust( ) → {boolean}
Returns: true if the LOD is being automatically adjusted, false if it is being manually adjusted.

Gets whether the LOD is being automatically adjusted.

(static) getBoundaryLevelAdjust( ) → {number}
Returns: The boundary level adjust factor.

Deprecated: This function is deprecated and will be removed.

(static) getDesktopLODTargetFPS( ) → {number}
Returns: The target desktop LOD FPS, in Hz.

Gets the target desktop LOD FPS.

(static) getHMDLODTargetFPS( ) → {number}
Returns: The target HMD LOD FPS, in Hz.

Gets the target HMD LOD FPS. The target FPS in HMD mode. The LOD is adjusted to ...

(static) getLODFeedbackText( ) → {string}
Returns: A text description of the current level of detail rendered.

Gets a text description of the current level of detail rendered.

Example

Report the current level of detail rendered.

print("You can currently see: " + LODManager.getLODFeedbackText());
(static) getLODTargetFPS( ) → {number}
Returns: The target LOD FPS, in Hz.

The target LOD FPS per the current desktop or HMD display mode, capped by the target refresh rate.

(static) getOctreeSizeScale( ) → {number}
Returns: The octree size scale.

Deprecated: This function is deprecated and will be removed. Use the lodAngleDeg property instead.

(static) setAutomaticLODAdjust( value )

Sets whether the LOD should be automatically adjusted.

Parameters

Name Type Description
value boolean

true to automatically adjust the LOD, false to manually adjust it.

(static) setBoundaryLevelAdjust( boundaryLevelAdjust )

Deprecated: This function is deprecated and will be removed.

Parameters

Name Type Description
boundaryLevelAdjust number

The boundary level adjust factor.

(static) setDesktopLODTargetFPS( value )

Sets the target desktop LOD FPS.

Parameters

Name Type Description
value number

The target desktop LOD FPS, in Hz.

(static) setHMDLODTargetFPS( value )

Sets the target HMD LOD FPS.

Parameters

Name Type Description
value number

The target HMD LOD FPS, in Hz.

(static) setOctreeSizeScale( sizeScale )

Deprecated: This function is deprecated and will be removed. Use the lodAngleDeg property instead.

Parameters

Name Type Description
sizeScale number

The octree size scale.

Signal Details

autoLODChanged( )
Returns: Signal

Triggered when whether or not the LOD is being automatically adjusted changes.

LODDecreased( )
Returns: Signal

Not triggered.

Deprecated: This signal is deprecated and will be removed.

LODIncreased( )
Returns: Signal

Not triggered.

Deprecated: This signal is deprecated and will be removed.

lodQualityLevelChanged( )
Returns: Signal

Triggered when the lodQualityLevel property value changes.

Deprecated: This signal is deprecated and will be removed.

worldDetailQualityChanged( )
Returns: Signal

Triggered when the world detail quality changes.