Jump to content

many with CreateBox items reduce the frame rate


hollow
 Share

Recommended Posts

Hello guys,

I'm new to BJS, and I find it is a great Framework - many thanks for your work @all.

Note: please excuse my english, I'm a german people, I hope the wrong words i use are less.

I have an situation, where the frame rate will be enormously reduced after some more boxes are created on an scene.

The created PG is http://www.babylonjs-playground.com/#1AFQPV#1

on lines 21-23 ... activate one line and move short the field, than wait for the real frame rate (any seconds @ 50^2 fields) ... here it is about 6fps :(

 

With an old babylon-version from 2016-09-17 (2.5 prerelease) and before this is not the same fail (file attached):

- index_2.5.html (with local babylon.2.5.js [minified] - i have no other version from this time)
- index.html with online BJS ...

the *.html's are downloaded from PG and modified for test with local file, the frame-rate is not shown, but the smoothing move is apparent.

 

Thanks for your help, ask me if more details are needed.

 

fps_on_CreateBox.zip

Link to comment
Share on other sites

Hi there and welcome to the forum!

I didn't try things with the old babylon version but I think it's to be expected that the frame rate drops at a certain amount of items. The main question is what you plan to do with those box and then decide how to avoid creating too man separate meshes.

For example you could use instances to increase performances: http://www.babylonjs-playground.com/#1AFQPV#3 ... but instances share geometry and material.

For even more performance you can merge the meshes: http://www.babylonjs-playground.com/#1AFQPV#4 ... but that means there are no separate boxes anymore, just one big mesh.

Hope that helps. Tell us a bit more about what you want to achieve and maybe we can find a good solution for your needs! :)

Link to comment
Share on other sites

Hi and thanks for the fast answer!

That's awesome. It should be like an chess-field ... with single boxes to align on a highmap.

The merge is not an option, because the single-fields are not able to set to different materials/colors (even before merge)/. I tried, but the result is only one color.

Yes, the instance is a good improvement, that I will probably use further. Thanks for that!

 

But it will be very interesting, why this behaviour happens. (please don't ignore the attached file :) )

Thanks so long.

Link to comment
Share on other sites

Hello again,

thanks for your replies.

@davrous: thats a really interesting tutorial/game, but like my test with the example by @iiceman there is no possibility to change single colors or enable the possibility to relase boxes from QR-Code by clicking it after the merge, isn't it?

but the performance increase is really good.


@JohnK: thats also a good idea and the performance seems same as good as the instances and the merge ... and it is very easy to manage the single particles, excepted the switching color on even numbers :) ... see http://www.babylonjs-playground.com/#1AFQPV#5

 

... because there seems no right reason that now the frame-rate goes down on easy create same box, but some good ways to go round, this topic can marked as solved

Thanks so long. Do the same good work again.

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