syed samoon Posted February 24, 2018 Share Posted February 24, 2018 Hi everyone, i was stuck in performance of game DETAIL: the above picture shows the game with screen zoom is 100 percentage this picture show the screen zoom size with 25 percentage when the zoom size is 100 % the game performance is good but when i change the zoom size of screen to below 50 percentage there is lack of performance(the player will move very very slowly) when screen zoom size is 67 - 100 percentage fps : 60 when screen zoom size is 50 - 67 percentage fps : 45 - 50 when screen zoom size is less than 50 percentage fps : 15 - 20 when on igcnito mode when screen zoom size is 200 - 500 percentage fps : 55 when screen zoom size is 110 - 200 percentage fps : 50 when screen zoom size is 67 - 100 percentage fps : 45 when screen zoom size is 50 - 67 percentage fps : 35 when screen zoom size is less than 50 percentage fps : not running anyone know what is the problem??? and how to make fps 60 for all zoom size of screen?? Quote Link to comment Share on other sites More sharing options...
brianzinn Posted February 24, 2018 Share Posted February 24, 2018 I don't know what zoom size is. Did you set the canvas width and height and are you changing the CSS or window size or is it a camera property you are changing? FPS will decrease accordingly with numbers of calculations per frame. Have you looked at the tips for increasing performance (https://doc.babylonjs.com/how_to/optimizing_your_scene)? Quote Link to comment Share on other sites More sharing options...
waverider Posted February 24, 2018 Share Posted February 24, 2018 Hy there nice scene, this is what i use canvas.style.width = "25%"; canvas.style.height = "25%"; canvas.style.webkitTransform = "scale3d(4.0, 4.0, 1.0)"; canvas.style.webkitTransformOrigin = "0 0 0"; NB. the only drawback with using this is that you'll need to caliberate picking collision if you're using one, it doesn't work well with the GUI unless you use html UI which is not the best sometimes. Or you can use the native function engine.setHardwareScalingLevel(2.5), sometimes i combine this with the code above so i don't loose much quality see the difference in the fps gain https://www.babylonjs-playground.com/#5YRWQA https://www.babylonjs-playground.com/#5YRWQA#1 Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 26, 2018 Author Share Posted February 26, 2018 In normal screen size the GPU frame rate is 10 - 20 but when i zoom the screen size the GPU frame rate is become 117 - 134 how to fix this Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 26, 2018 Share Posted February 26, 2018 the main question is (a @brianzinn already asked) what do you mean by "zoom". 117-134 FPS seems a bit odd, and is probably a miscalculation due to some factors. I just tried zooming in and out in the browser (ctrl + and ctrl -) and got a steady 60 fps. would be great to see your scene reproduced, and also know how you measure FPS and what version of babylon you are using. Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 26, 2018 Author Share Posted February 26, 2018 19 minutes ago, RaananW said: the main question is (a @brianzinn already asked) what do you mean by "zoom". 117-134 FPS seems a bit odd, and is probably a miscalculation due to some factors. I just tried zooming in and out in the browser (ctrl + and ctrl -) and got a steady 60 fps. would be great to see your scene reproduced, and also know how you measure FPS and what version of babylon you are using. BABYLON (V3.1.1) AND 117 - 134 is not a fps it is a current frame rate of GPU Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 26, 2018 Share Posted February 26, 2018 Thanks. 134 is practically impossible (if anyone wants to correct this statement, please do). And you still haven't answered the question, what do you mean by "zoom". It might be a bug that was already fixed. If you want to give 3.2.0 (alpha) a try, please do. It is backwards compatible, so you could simple update the babylon file and see if it works better. A demo scene where the behavior is reproduced would be great as well, so we can all understand what you are trying to achieve. Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 26, 2018 Author Share Posted February 26, 2018 i want to optimise my game for smartphone. when i run the game in my smartphone the dpi size is different(zoom size is low) then i will start testing with same aspect in my pc as a result i got same permance lack Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 26, 2018 Author Share Posted February 26, 2018 so what i will trying to fix that is there any other way?? Quote Link to comment Share on other sites More sharing options...
Guest Posted February 26, 2018 Share Posted February 26, 2018 If by zooming you mean increasing the DPI with the browser, the behavior that you are seeing is normal. You increase DPi so there are more pixels to wrote. With a zoom of 50% there 4 times more pixels to draw You can compensate by detecting the DPI and calling setHardwareScalingLevel likle @waverider mentioned earlier Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 27, 2018 Author Share Posted February 27, 2018 how to optimize the scene for mobile. how to use setHardwareScalingLevel function Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 27, 2018 Share Posted February 27, 2018 Maybe try using the scene optimizer? http://doc.babylonjs.com/how_to/how_to_use_sceneoptimizer Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 27, 2018 Author Share Posted February 27, 2018 anyone has model script And thank @RaananW it is working Quote Link to comment Share on other sites More sharing options...
syed samoon Posted February 28, 2018 Author Share Posted February 28, 2018 On 2/26/2018 at 5:52 PM, RaananW said: If you want to give 3.2.0 (alpha In babylon 3.2.0 setEnabled is not working mesh.setEnabled(0); Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 28, 2018 Share Posted February 28, 2018 setEnabled takes a Boolean as the first parameter. mesh.setEnabled(false) would be the right way to go. if this doesn't work something is truly wrong, but I believe we would hear about it already. 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.