Pryme8 Posted August 29, 2017 Share Posted August 29, 2017 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? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 29, 2017 Share Posted August 29, 2017 I get 60 no matter what. Firefox drops to 59 every once in a while. Am running win10 wt GTX 1050 on a 2560 x 1600 display. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 29, 2017 Author Share Posted August 29, 2017 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? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted August 29, 2017 Share Posted August 29, 2017 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. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 29, 2017 Author Share Posted August 29, 2017 Yeah I'm sure my main rig its not a problem, but here at the dental office we have a crap PC >_<. So there is no way to set up a "render region" on the UI advance texture? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 29, 2017 Share Posted August 29, 2017 If you have no hardware accelerated support this will be complex for sure! you can try to optimize it bu using a custom resolution: http://doc.babylonjs.com/overviews/gui#adaptive-scaling Pryme8 and jerome 2 Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted August 30, 2017 Share Posted August 30, 2017 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? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 30, 2017 Author Share Posted August 30, 2017 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... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 30, 2017 Share Posted August 30, 2017 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 Pryme8 and jerome 2 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 31, 2017 Author Share Posted August 31, 2017 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#60https://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. brianzinn 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted August 31, 2017 Share Posted August 31, 2017 SO you think the perf lost comes from the update itself ? not from the rendering? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted August 31, 2017 Author Share Posted August 31, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 1, 2017 Share Posted September 1, 2017 there is no resize per se to adapt. The shader will just pick it as a texture and scale it using hardware texture2d reads So basically if you create a texture of 100x100, then the texture will remains at this size and it will be scale up by shaders so this is completely free. Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted September 1, 2017 Author Share Posted September 1, 2017 I'm starting to think the fps drop is reserved to the client I was working on. On every other client it's running fine so maybe it's a hardware issue. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted September 1, 2017 Share Posted September 1, 2017 You have some very cool GUI controls also in other posts! Thanks for sharing. Pryme8 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.