SceneOptimizer improvement mode?

I’m a little confused about how the improvement mode of SceneOptimizer is supposed to operate.

SceneOptimizer.isInImprovementMode can be set/changed, but even when true, _currentPriorityLevel is only ever incremented (same as when isInImprovementMode === false). Shouldn’t _currentPriorityLevel progressively decrement back to zero in improvement mode i.e. previously applied optimizations reverted?

I think I’ve just misunderstood what improvementMode is meant to do.

improvementMode 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)

Indeed, isInImprovementMode=true is supposed to be used when the current frame rate is higher than your target frame rate. In that case, the optimization rules are in fact not optimizations but “quality improvements” instead (enable shadows, enable lens flares, etc). Then, the optimizer enables each one until the frame rate drops below the target fps.

Thanks @Evgeni_Popov. I ended up making a custom optimizer based in part on the Babylon.js concept, as I needed something that moves dynamically in both directions i.e. applies progressive optimizations when the frame rate falls below the target, but progressively reverts the optimisations if/when the frame rate recovers above the target. I’m dealing with the sort of scenes where this can happen.