Jump to content

Performance drop using registerBeforeRender method


suresh1187
 Share

Recommended Posts

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.

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