fenomas Posted April 29, 2015 Share Posted April 29, 2015 @fenomas:1. I want to keep it as a function because it implies some drawbacks that the user has to understand. So I prefer having a explicit function there Well, or setStatic(boolean), or even just freeze() / unfreeze(), etc. My aim was to obviate the question Jerome asked. The fact that meshes keep a cached world matrix is an implementation detail, and it's better if the user can intuit what APIs do without knowing how the implementation works, was my thinking. 2. Already the case: https://github.com/BabylonJS/Babylon.js/blob/master/Babylon/Mesh/babylon.abstractMesh.ts#L189 Oh.. not sure why, but my scenes blew up if I froze stuff without waiting one frame. Once this API is in the playground I'll send you a repro. 3. Billboards need to have a new worldmatrix per frame. Because they are facing the camera I understand that, just wondering if any other optimization is possible. (Though it now occurs to me that it'll still be a good optimization to freeze billboard meshes if they're far from the camera, and unfreeze them if they get close!) Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 29, 2015 Share Posted April 29, 2015 for 1. I.m convinced we have to keep the API clear on its goal. It does not freeze all the object because for instance animations still work 2. This is online Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 29, 2015 Author Share Posted April 29, 2015 Here are the results of setting isEnabled(false) when showing the Dock panel & suspending Main panel, for my worse case Menu (Look & Feel / 894 meshes) : IsEnabled selection Potential FPS-------------- -------------- --------------------- true 90 ms 11 false 19 ms 41 Meshes merged too 3.5 ms 145 (156 meshes) Pretty convincing. After implementing freeze, the Main panel when actually visible, should get some of that improvement in mesh selection time. I think that the lines of unfreeze are in the wrong order though, since the computeWorldMatrix(true) call does nothing:public unfreezeWorldMatrix() { this.computeWorldMatrix(true); this._isWorldMatrixFrozen = false;}Think there should be a way to tell if a mesh is frozen. This would allow code that perhaps animated it, to get the value, unfreeze it, & set it back to what it was. Like POV . BTW, my implementation of freeze in Dialog will be to override the methods, to do the children as well. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 30, 2015 Share Posted April 30, 2015 thank you for the PR. I'll validate it asap! 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.