https://playground.babylonjs.com/#EYTC3C#1
So if you toggle between using a shader and not for the bones things go crazy. Not really sure if there is some other command I need to do when switching back or if this is a bug.
https://playground.babylonjs.com/#EYTC3C#1
So if you toggle between using a shader and not for the bones things go crazy. Not really sure if there is some other command I need to do when switching back or if this is a bug.
The bug occurs when switching from computeBonesUsingShaders = false
to true
.
My guess is that the bones properties (position, rotation) are modified by the software skinning computation and not reset when switching to GPU skinning, but it does not explain why the bones for the legs are still ok after the switchâŚ
[EDIT]
I stand corrected, the bones of the legs are wrong too.
After quick inspection, it seems the vertex buffer is updated by the software skinning but not reset back when going back to GPU skinning.
I donât know if itâs by design or not⌠Handling this by the engine would mean doing a copy of the vertex (and normal) buffers for all meshes so that we can reset them back in the case you switch from software to gpu skinning. That seems a bit heavy to me⌠Maybe itâs the responsibility of the user to do it (the duplication of the buffers and setting them back when switching to GPU skinning)? @Deltakosh or @sebavan, what do you think?
For me, this switch is not something you should change continuously: you normally set a value at start and donât change it afterward.
[/EDIT]
I have a project where we need to have the mesh be pick-able at certain times and other times not that has skeletal animations on it. So we for specific reasons need to be able to. Might be kinda a fringe case, but figured it was good to bring up.
Technically it is not supposed to be changed live. you have to stick with one way and don;t change later on
In fact, the source position and normal buffers are currently already saved in internal data of the meshesâŚ
So I think it would be easy to reset the buffer to their original values when switching computeBoneUsingShaders
from false to true.
Going to make a PR for it.
Please do! That will knock one major item off my list.
PR: