foxcoder Posted August 29, 2018 Share Posted August 29, 2018 hi , if i load one mesh , and make multiply copies for the mesh and skeleton , if mesh.computeBonesUsingShaders = false , and create animation scene.beginAnimation for cloned skeleton with different setting , the mesh animate all the same , below is the example i created in playgound https://playground.babylonjs.com/indexStable.html#QY1WYT#12 it can be fixed by set mesh.computeBonesUsingShaders = true , but i need to get updated boundingbox in the end of the animation , using shaders won't update the boundingbox even use refreshBoundingInfo , so another question , is it possible to get new bounding box at the end of animation using computeBonesUsingShaders = true ? Thank you in advance Best Regards Gee Quote Link to comment Share on other sites More sharing options...
foxcoder Posted August 29, 2018 Author Share Posted August 29, 2018 hi , just to reply my self , through start reading the source code , i found the issue, for software skin , babylon will do mesh.applySkeleton on every frame , the trouble is clone the meth , will not get a new copy of Geometry , and copy function don't provide copy geometry parameter, i manually copy geometry after clone , solve the issue , code below do the trick : let geometry = rabbit2.geometry.copy(BABYLON.Geometry.RandomId()); geometry.applyToMesh(rabbit2); geometry = rabbit3.geometry.copy(BABYLON.Geometry.RandomId()); geometry.applyToMesh(rabbit3); below is an updated playground , https://playground.babylonjs.com/indexStable.html#U0F7JI#2 so is it a proper workaround ? will it have any side affect other than performance ? Best Regards Gee 2 hours ago, foxcoder said: hi , if i load one mesh , and make multiply copies for the mesh and skeleton , if mesh.computeBonesUsingShaders = false , and create animation scene.beginAnimation for cloned skeleton with different setting , the mesh animate all the same , below is the example i created in playgound https://playground.babylonjs.com/indexStable.html#QY1WYT#12 it can be fixed by set mesh.computeBonesUsingShaders = true , but i need to get updated boundingbox in the end of the animation , using shaders won't update the boundingbox even use refreshBoundingInfo , so another question , is it possible to get new bounding box at the end of animation using computeBonesUsingShaders = true ? Thank you in advance Best Regards Gee Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 29, 2018 Share Posted August 29, 2018 yup, this is an expected behavior and instead of cloning the geometry you could call makeGeometryUnique on the mesh: https://playground.babylonjs.com/indexStable.html#U0F7JI#3 GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
foxcoder Posted August 30, 2018 Author Share Posted August 30, 2018 11 hours ago, Sebavan said: yup, this is an expected behavior and instead of cloning the geometry you could call makeGeometryUnique on the mesh: https://playground.babylonjs.com/indexStable.html#U0F7JI#3 greate , thx 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.