Class SceneOptimizer
Hierarchy
- SceneOptimizer
Implements
Index
Constructors
Properties
Accessors
Methods
Constructors
constructor
-
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
on Failure ObservableSearch playground for onFailureObservable
Defines an observable called when the optimizer is not able to reach the target frame rate
on New Optimization Applied ObservableSearch playground for onNewOptimizationAppliedObservable
Defines an observable called when the optimizer enables an optimization
on Success ObservableSearch playground for onSuccessObservable
Defines an observable called when the optimizer reaches the target frame rate
Accessors
current Frame Rate
-
Gets the current frame rate checked by the SceneOptimizer
Returns number
current Priority Level
-
Gets the current priority level (0 at start)
Returns number
is InImprovement Mode
-
Gets a boolean indicating if the optimizer is in improvement mode
Returns boolean
optimizations
-
Gets the list of active optimizations
Returns SceneOptimization[]
target Frame Rate
-
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 any
-
tracker Duration
-
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 any
-
Methods
disposeSearch playground for dispose
-
Release all resources
Returns void
resetSearch playground for reset
-
Reset the optimizer to initial step (current priority level = 0)
Returns void
startSearch playground for start
-
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 optimiatiation while frame rate is above the target frame rate
Returns void
stopSearch playground for stop
-
Stops the current optimizer
Returns void
Static Optimize AsyncSearch playground for OptimizeAsync
-
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
-
-
Returns void
-
-
-
Optional onFailure: () => void
defines a callback to call on failure
-
-
Returns void
-
-
Returns SceneOptimizer
the new SceneOptimizer object
-
Class used to run optimizations in order to reach a target frame rate
More details at https://doc.babylonjs.com/how_to/how_to_use_sceneoptimizer