Jump to content

Large FPS Drop when Using BABYLON.GUI


Pryme8
 Share

Recommended Posts

So I have noticed quite a large drop in FPS when I enable a GUI element to animate for a visual of the step/tick percentage of the block drop.  Im assuming it is because it is updating the 2d context of an entire canvas and not just a small section that is needed for this bar.

https://playground.babylonjs.com/#FQE3AA#17 <- with animation holds 49 fps;
https://playground.babylonjs.com/#FQE3AA#18 <- without holds 60 fps;

Im sure there is a simple fix for this performance issue, any ideas?

Link to comment
Share on other sites

well your running a beast of a machine that's why ^_^~!
Im on a crap PC right now (which is cool because it's closer to what most users will use), and so performance drops are more noticeable.

 

Oh and on this client I have hardware accelerate turned off, so maybe that's whats doing it? 

Link to comment
Share on other sites

Yeah.  Last dec I went to Win 10 & the new video card, & motherboard with i5.  Before was on Ubuntu with an older card.  Firefox truly SUCKS on Linux ( was kind of nice ). 

FYI, the 1050 is great & will make piece of crap much better, since it is a short card with NO extra power reqd.  Still double slot though.  Forget PCI requirements.

Link to comment
Share on other sites

Not sure whether this is appropriate, but totally just trying to be helpful - we have had the same problems and we ended up using a pixijs rendered canvas element for GUI, overlayed on top of a babylonjs rendered one for 3d scene. Blazing fast even on mobile. So far the most performant GUI solution we have. 

Haven't digged into it very deeply yet. I'm guessing it's because of the overhead of redrawing the whole dynamic texture?

Link to comment
Share on other sites

That's what I was thinking too @Baker Xiao, when I was working on my own game engine that's the hindrance I came across was updating the entire context when just a small region was changing caused a huge drop in performance.  I had to script "hot-zones"  which were areas on the context that needed to be updated but that was a huge head-ache...

Link to comment
Share on other sites

There is a mechanism in place to avoid refreshing the ui when nothing changes. But you are right, if something change all the UI is redrawn

You could think about  using two GUI: one for static and one for dynamic controls (if it makes sense)

 

I'm also tracking the need for this feature here: https://github.com/BabylonJS/Babylon.js/issues/2719

Link to comment
Share on other sites

Yeah because it looks like setting the idealWidth even to 10px makes no effective difference in rendertime once its scaled up to the scene.
https://playground.babylonjs.com/#FQE3AA#60


https://playground.babylonjs.com/#FQE3AA#61 <- if anyone wants to see more stuff working with it.. asd inputs work as of right now.  Just trying to work out some dumb bugs and then ill finish this up... I just have no time to focus on anything anymore it sucks.

Link to comment
Share on other sites

What is the scale up of the set width texture doing when it resizes it to fit the context? Is it restricting the data buffer to what ever you set the size to? if so then it might be the update itself if not it's the rendering.

 

it seems like it draws the same, just changes your scale kinds.

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