Am I using the Scene Optimizer Improvement Mode Incorrect?

So I have a setup with the scene optimizer, that once its reaches it FPS target it waits a few seconds then restarts the optimizer in improvement mode.

I was under the impression that if you are hitting your FPS marks that the improvement mode will try to step up the optimizations instead of degrade.

But in practice I’m not seeing it. I will throttle my fps to lets say 10 and have a target of 30, the optimizer works and starts degrading things like hardware scaling. Then during that process I set it to 30 so it thinks it hit its target. I get the notification that the FPS target was reached, and then I bump up my fps to uncapped so that the system thinks its ok to start bringing the hardware scaling back to normal but it does not. Its like it never does anything once toggled into improvement mode and restarted.

Am I using this incorrectly?

I believe the scene optimizer only reduces to get the requested fps, but it will not restore what it reduced.

It would be nice if the optimizer could do the opposite operation when the FPS goes up.
If we ask for 30 and the fps drops below 30, the optimizer starts to reduce to keep 30 fps minimum. But if the fps goes back to 40 let’s say (this happens depending on one zone to another), it should be able to restore what it reduced. But that doesn’t seem to be the case from what I see too.

In the documents it infers that is what improvement mode is supposed to do, unless I was reading that incorrectly.
https://doc.babylonjs.com/features/featuresDeepDive/scene/sceneOptimizer#improvement-mode

Yes and my this would be interesting if the optimizer could also restore the states it deduced. This is what I meant.

you have to restart it once it reaches its target. That was made specifically to avoid unwanted change. I preferred making sure the change of direction was really intentional from the developer standpoint

said differently you cannot start an optimizer with the optimize mode and then switch it later to improvment mode

Ohhhhhh, so I just need two instances!? One in improvement and one in standard and just trigger them accordingly instead of toggling the prop and reset restarting it?

If this works I’m going to be so jazzed.

We should mention in the docs that once it’s started one it’s mode can’t be switched.

Yeah correct. This is why it is a constructor parameter :slight_smile:

Its not a constructor on the OptimizerAsync, can you set that prop after its creation on that class? Or is that property just reserved for new Optimizer(…)

Also, should I flip the optimization order when doing improvements?

yeah that’s the problem you cannot change it afterwards :frowning:

Ok cool, so I guess we should add that constructor prop to the OptimizerAsync but for now ill just use the base initializer.

1 Like