Jump to content

Babylon games performance can be improve by screen size?


syed samoon
 Share

Recommended Posts

Hi everyone,

   i was stuck in performance of game 

 

DETAIL:

dpi1.thumb.JPG.4e168946bb27ac67767750c15ba6f124.JPG

 

the above picture shows the game with screen zoom is 100 percentage

 

dpi2.thumb.JPG.d492b2011518ab82c2ea386671a9ddc0.JPG

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??

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...