Class SceneOptimizerOptions
Constructors
constructor
-
new SceneOptimizerOptions(
targetFrameRate?: number,
trackerDuration?: number,
): SceneOptimizerOptionsCreates a new list of options used by SceneOptimizer
Parameters
- targetFrameRate: number = 60
defines the target frame rate to reach (60 by default)
- trackerDuration: number = 2000
defines the interval between two checks (2000ms by default)
Returns SceneOptimizerOptions
- targetFrameRate: number = 60
Properties
optimizations
Gets the list of optimizations to apply
target Frame Rate
[60] Defines the target frame rate to reach (60 by default)
tracker Duration
[2000] Defines the interval between two checks (2000ms by default)
Methods
add Custom Optimization
-
addCustomOptimization(
onApply: (scene: Scene, optimizer: SceneOptimizer) => boolean,
onGetDescription: () => string,
priority?: number,
): SceneOptimizerOptionsAdd a new custom optimization
Parameters
- onApply: (scene: Scene, optimizer: SceneOptimizer) => boolean
defines the callback called to apply the custom optimization (true if everything that can be done was applied)
- onGetDescription: () => string
defines the callback called to get the description attached with the optimization.
- priority: number = 0
defines the priority of this optimization (0 by default which means first in the list)
Returns SceneOptimizerOptions
the current SceneOptimizerOptions
- onApply: (scene: Scene, optimizer: SceneOptimizer) => boolean
add Optimization
-
Add a new optimization
Parameters
- optimization: SceneOptimization
defines the SceneOptimization to add to the list of active optimizations
Returns SceneOptimizerOptions
the current SceneOptimizerOptions
- optimization: SceneOptimization
StaticHigh Degradation Allowed
-
Creates a list of pre-defined optimizations aimed to have a big impact on the scene visual
Parameters
OptionaltargetFrameRate: numberdefines the target frame rate (60 by default)
Returns SceneOptimizerOptions
a SceneOptimizerOptions object
StaticLow Degradation Allowed
-
Creates a list of pre-defined optimizations aimed to reduce the visual impact on the scene
Parameters
OptionaltargetFrameRate: numberdefines the target frame rate (60 by default)
Returns SceneOptimizerOptions
a SceneOptimizerOptions object
StaticModerate Degradation Allowed
-
Creates a list of pre-defined optimizations aimed to have a moderate impact on the scene visual
Parameters
OptionaltargetFrameRate: numberdefines the target frame rate (60 by default)
Returns SceneOptimizerOptions
a SceneOptimizerOptions object
Defines a list of options used by SceneOptimizer
Description
More details at https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer