Fuentes Posted August 22, 2016 Share Posted August 22, 2016 Hi everyone: I want to know how to limit the FPS that Bjs render. I'm newbie in this framework and i don't understand how to use the SceneOptimizer helper. Any simple sample to do this? Many thanks in advance. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 22, 2016 Share Posted August 22, 2016 Hello, You can use it this way: BABYLON.SceneOptimizer.OptimizeAsync(scene); or BABYLON.SceneOptimizer.OptimizeAsync(scene, BABYLON.SceneOptimizerOptions.ModerateDegradationAllowed(), null, null); Tutorial here : http://doc.babylonjs.com/tutorials/How_to_use_SceneOptimizer Quote Link to comment Share on other sites More sharing options...
Fuentes Posted August 22, 2016 Author Share Posted August 22, 2016 Ok, but how can i limit the FPS? I read the docs but i don't figure it out how to put all together. Actually i got this: BABYLON.SceneOptimizer.OptimizeAsync( scene, BABYLON.SceneOptimizerOptions.HighDegradationAllowed(), function() { engine.runRenderLoop(function() { scene.render(); }); }, function() { console.error("The engine can't init"); } ); Where set the FPS that i want? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted August 22, 2016 Share Posted August 22, 2016 Here is a playground http://www.babylonjs-playground.com/#25APLS#0 You must know that SceneOptimizer does not limit the FPS, it helps keep the FPS has a given value by optimizing the stage. SceneOptimizer will not limit your FPS to a max value Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 25, 2016 Share Posted August 25, 2016 Hey! Why do you want to limit the framerate? Quote Link to comment Share on other sites More sharing options...
jerome Posted August 25, 2016 Share Posted August 25, 2016 in the runRenderLoop() call, you could just test the elapsed time since the last call and render the scene only if this time is enough for your need The Leftover 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.