API

Class SceneOptimizer

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

Implements

Index
  • Creates a new SceneOptimizer

    Parameters

    • scene: Scene

      defines the scene to work on

    • Optionaloptions: SceneOptimizerOptions

      defines the options to use with the SceneOptimizer

    • autoGeneratePriorities: boolean = true

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

    • improvementMode: boolean = false

      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

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

  • 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