Adem Posted December 23, 2016 Share Posted December 23, 2016 hullo everyone, how can i use a statement like this in babylonjs If(Fps < 10){ //optimizing tools here } Can someone post a playground for this..thanks Quote Link to comment Share on other sites More sharing options...
adam Posted December 23, 2016 Share Posted December 23, 2016 Have you read this? https://doc.babylonjs.com/tutorials/How_to_use_SceneOptimizer Adem and Dad72 2 Quote Link to comment Share on other sites More sharing options...
JohnK Posted December 23, 2016 Share Posted December 23, 2016 First of all I know from your earlier post that you have already checked out the documentation for scene optimization. If you want to find out how to get the fps in BabylonJS then the best way is to go to the documention site and in the search box (top right hand corner) enter fps and search. From the resulting list note that the engine class must have an entry related to fps, so go there. On the engine page either use the drop down menu and the down arrow to scroll down until you get an entry that has fps in or open the brower's - find on page- option and use it to check for fps on the page. Both of these ways will lead you to engine.getFps(). Even easier typing "Babylonjs fps" into google leads to a forum question http://www.html5gamedevs.com/topic/6672-measure-fps/ which includes the answer engine.getFps() Playground http://www.babylonjs-playground.com/#1BVAHH#1 Having (perhaps) just answered your question this proves that the way I have just stated is the second best way and the best way is to ask on the forum. But then you have to wait until someone answers you question whereas the described way leads you straight to an answer without waiting to see if anybody understands the question correctly and gives you a useful answer. So maybe after all the best way is to do some searching in the documentation and/or forum and/or google. Second of all why only optimize if your project falls below 10 fps, surely it is better to fully optimize your project in the first place. Third of all Convergence has some great tips on optimization http://www.html5gamedevs.com/topic/26886-creating-a-city-building-simulator/?do=findComment&comment=154182 Fourth of all welcome from me to the forum - you will soon get use to peoples idiocentric sense of humour. Adem 1 Quote Link to comment Share on other sites More sharing options...
adam Posted December 23, 2016 Share Posted December 23, 2016 I came up with this using the PG's SSAO example: http://www.babylonjs-playground.com/#27NUSW Is it normal for the scene optimizer to keep calling the optimization.apply() even if the target fps has been reached? I think that was because an old optimizer was still running in the background after editing my PG. optimizations are applied only if the target fps is not met: 10 fps http://www.babylonjs-playground.com/#27NUSW#2 60 fps http://www.babylonjs-playground.com/#27NUSW#1 NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
aWeirdo Posted December 23, 2016 Share Posted December 23, 2016 @Adem I would have to suggest that the best scene optimation is done pre-run-time, using low poly meshes, only rendering what's needed, optimizing code to run smooth and as fast as possible, using best practices when coding, etc. gryff and Adem 2 Quote Link to comment Share on other sites More sharing options...
Adem Posted December 23, 2016 Author Share Posted December 23, 2016 thanks guys, i now have the knowledge on how to optimize my scene 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.