thrice Posted July 15, 2018 Share Posted July 15, 2018 The situation is this: While attempting to improve performance by doing some ugly things with sprites, which use onAfterWorldMatrixUpdatedObservable, hook, I noticed an issue in my scene: Basically: I have one main board mesh which almost everything minus player hands are parented to (not directly, but each player has a board which is parented to the main board mesh, etc). -- The issue is, when I parent a mesh to the board, and I add an onAfterWorldMatrixUpdatedObservable hook, it is getting called every single frame. -- Which leads me to believe that possibly every object which is part of the main board mesh descendants tree, is also having their world matrices updated on every frame,which could obviously hopefully account for some of the performance issues that I've been having. (The same mesh, unparented, does not have onAfterWorldMatrixUpdated being called each frame.) I browsed the codebase, but didn't see anything obvious which could be causing this behavior. So I am wondering if anyone knows of any gotchas or non obvious places or things that could be causing the worldMatrix update. -- I can likely solve it by recursively freezingWorldMatrix of all the children, however I would like to figure out what is going on as well. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Hello! theorically WM are updated if: - You change position, rotation, rotationQuaternion, scaling, pivot matrix - If you change the previous properties in any ascendant - If the mesh is billboard Are you seeing something different? Quote Link to comment Share on other sites More sharing options...
thrice Posted July 19, 2018 Author Share Posted July 19, 2018 Thanks delta, -- that is mostly what I thought. I am seeing different behavior, it is firing the onWorldMatrixUpdated on every frame for all of it's non worldMatrixFrozen children, when none of those things should be changing. - I am stuck on version 3.1.alpha5 ATM, so if there were any bugs with anything ^ which were fixed after 3.1.alpha5 that could be helpful to know, but I'll dig into the issue further. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 19, 2018 Share Posted July 19, 2018 I could help if you can provide a repro in the PG I can't remember anything specific since 3.1 but it was long time ago (almost a year) so a lot of things improved 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.