MackeyK24 Posted November 13, 2016 Share Posted November 13, 2016 Is there a performance impact of calling MANY 'scene.registerBeforeRender' for each scene component could be hundreds OR should there be ONE BIG scene.registerBeforeRender and i maintain my own array of scene components i want to 'tick' along and loop thru my array calling 'myobject.update' i would much rather not have to maintain an array of scene components for ticking and simple call: scene.registerBeforeRender(myobject.update) and scene.unregisterBeforeRender(myobject.update) for each and every scene component i am going to have??? Thanks for the info Quote Link to comment Share on other sites More sharing options...
adam Posted November 13, 2016 Share Posted November 13, 2016 http://www.babylonjs-playground.com/#ZHTLQ#0 Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted November 13, 2016 Author Share Posted November 13, 2016 So you are saying that is kool, to have many calls to scene.registerBeforeRender ??? I see the loop... But i don't see any notes or info that says the loop is bad or its ok or what Quote Link to comment Share on other sites More sharing options...
adam Posted November 13, 2016 Share Posted November 13, 2016 I thought the PG would speak for itself. This is unlikely to be your bottleneck. Don't worry about it. Quote Link to comment Share on other sites More sharing options...
fenomas Posted November 13, 2016 Share Posted November 13, 2016 It's useful to remember that Babylon does a lot of work - matrix multiplications, vertex uploads, etc. - for every mesh in your scene, every frame. Basically the only time you need to consider performance is when your code starts doing a comparable amount of work. Anything else is effectively free, compared to the cost of rendering 3D objects. Quote Link to comment Share on other sites More sharing options...
MackeyK24 Posted November 14, 2016 Author Share Posted November 14, 2016 Thanks 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.