Jump to content

computeBonesUsingShaders = false , animation can not apply to individual mesh


foxcoder
 Share

Recommended Posts

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

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...