hollow Posted January 23, 2017 Share Posted January 23, 2017 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 Quote Link to comment Share on other sites More sharing options...
iiceman Posted January 23, 2017 Share Posted January 23, 2017 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! gryff and kpgbrink 2 Quote Link to comment Share on other sites More sharing options...
hollow Posted January 23, 2017 Author Share Posted January 23, 2017 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. Quote Link to comment Share on other sites More sharing options...
davrous Posted January 23, 2017 Share Posted January 23, 2017 Hi, It's because you're increasing a lot the number of draw calls. Please read my comment there: that completely apply to your current issue. David Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 23, 2017 Share Posted January 23, 2017 Lots of meshes same geometry different colors or material try the solid particle system http://doc.babylonjs.com/overviews/Solid_Particle_System gryff and jerome 2 Quote Link to comment Share on other sites More sharing options...
gryff Posted January 23, 2017 Share Posted January 23, 2017 @iiceman : A couple of nice clear, simple and straight forward examples @JohnK : Another good suggestion cheers, gryff Quote Link to comment Share on other sites More sharing options...
hollow Posted January 24, 2017 Author Share Posted January 24, 2017 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. 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.