Options
All
  • Public
  • Public/Protected
  • All
Menu

Class used to run optimizations in order to reach a target frame rate

description

More details at https://doc.babylonjs.com/how_to/how_to_use_sceneoptimizer

Hierarchy

  • SceneOptimizer

Implements

Index

Constructors

  • Creates a new SceneOptimizer

    Parameters

    • scene: Scene

      defines the scene to work on

    • Optional options: SceneOptimizerOptions

      defines the options to use with the SceneOptimizer

    • Optional autoGeneratePriorities: boolean

      defines if priorities must be generated and not read from SceneOptimization property (true by default)

    • Optional improvementMode: boolean

      defines if the scene optimizer must run the maximum optimization while staying over a target frame instead of trying to reach the target framerate (false by default)

    Returns SceneOptimizer

Properties

onFailureObservable: Observable<SceneOptimizer>

Defines an observable called when the optimizer is not able to reach the target frame rate

onNewOptimizationAppliedObservable: Observable<SceneOptimization>

Defines an observable called when the optimizer enables an optimization

onSuccessObservable: Observable<SceneOptimizer>

Defines an observable called when the optimizer reaches the target frame rate

Accessors

  • get currentFrameRate(): number
  • Gets the current frame rate checked by the SceneOptimizer

    Returns number

  • get currentPriorityLevel(): number
  • Gets the current priority level (0 at start)

    Returns number

  • get isInImprovementMode(): boolean
  • set isInImprovementMode(value: boolean): void
  • Gets or sets a boolean indicating if the optimizer is in improvement mode

    Returns boolean

  • Gets or sets a boolean indicating if the optimizer is in improvement mode

    Parameters

    • value: boolean

    Returns void

  • Gets the list of active optimizations

    Returns SceneOptimization[]

  • get targetFrameRate(): number
  • set targetFrameRate(value: number): void
  • Gets or sets the current target frame rate (60 by default)

    Returns number

  • Gets or sets the current target frame rate (60 by default)

    Parameters

    • value: number

    Returns void

  • get trackerDuration(): number
  • set trackerDuration(value: number): void
  • Gets or sets the current interval between two checks (every 2000ms by default)

    Returns number

  • Gets or sets the current interval between two checks (every 2000ms by default)

    Parameters

    • value: number

    Returns void

Methods

  • dispose(): void
  • Release all resources

    Returns void

  • reset(): void
  • Reset the optimizer to initial step (current priority level = 0)

    Returns void

  • start(): void
  • Start the optimizer. By default it will try to reach a specific framerate but if the optimizer is set with improvementMode === true then it will run all optimization while frame rate is above the target frame rate

    Returns void

  • stop(): void
  • Stops the current optimizer

    Returns void

  • Helper function to create a SceneOptimizer with one single line of code

    Parameters

    • scene: Scene

      defines the scene to work on

    • Optional options: SceneOptimizerOptions

      defines the options to use with the SceneOptimizer

    • Optional onSuccess: () => void

      defines a callback to call on success

        • (): void
        • Returns void

    • Optional onFailure: () => void

      defines a callback to call on failure

        • (): void
        • Returns void

    Returns SceneOptimizer

    the new SceneOptimizer object

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited constructor
  • Static method

Settings

Theme