Jump to content

Text on a box with GUI


Hillardo
 Share

Recommended Posts

It needs about 7 to 8s until it is rendered on my computer. 

My function TextureCreat runs for 2s, but  1.6s are used by CreateForMesh from Babylon.GUI. 

Then there is Animation Frame Fired twice one time for 1.6s and then 1.17s.

The profiler marks this parts as bootleneck. Recalculate Style and Layout are both called around 160 times.

I read that these are caused by changing the size of elements.

I altered my code, so that I write, read, write, read and write in five blocks. Before I had write, read,k write, read and write and that looped 50 times.

But it didn't change the performance or the appearance of Recalculate Style and Layout.

Updated Playground: https://www.babylonjs-playground.com/#BGCWDH#1

 

Link to comment
Share on other sites

You are generating quite a big number of textures and doing a lot of operation in your TextureCreate

To identify the bottleneck, I would recommend reducing number of box and also stripping off so part of the code to understand where the CPU is most used

 

Every single GUI texture will require a canvas, a texture in memory and text rendering so I'm not sure you can render all that amount of texts without waiting a bit

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