suresh1187 Posted January 10, 2018 Share Posted January 10, 2018 Hi all, I face drastic drop in performance(fps), when i change the canvas background during runtime, e.g: engine.runRenderLoop(() => { if(this.state.counter == 2){ var background = new Layer("back", "image1.png", scene); } if(this.state.counter == 4){ var background = new Layer("back", "image2.png", scene); } if (scene) { scene.render(); } }); I have tried it using registerBeforeRender method, but i face the similar performance issue. Is there any other method to change the background during runtime without losing performance(fps). Note : i am using react-babylonjs package. Thanks, Suresh. Quote Link to comment Share on other sites More sharing options...
suresh1187 Posted January 10, 2018 Author Share Posted January 10, 2018 Solved. I think , var background = new Layer("back", "image1.png", scene); is executed multi times,which leads to performance issue. Quote Link to comment Share on other sites More sharing options...
brianzinn Posted January 10, 2018 Share Posted January 10, 2018 Post back, if it's not solved. If you change the background too often will be slow. That's my package, but not related. 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.