Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bones switching to manual on memory cleanup #9

Closed
sgynn opened this issue Apr 12, 2019 · 6 comments
Closed

Bones switching to manual on memory cleanup #9

sgynn opened this issue Apr 12, 2019 · 6 comments
Assignees

Comments

@sgynn
Copy link

sgynn commented Apr 12, 2019

System Information

  • Ogre Version: 2.1
  • Operating System / Platform: Windows
  • RenderSystem: DirextX11

Detailled description

When the bone memory manager cleanup is performed, the SkeletonInstance manual bones array becomes incorrect as it depends on the bone transform index which can change.
This causes some bones to randomly switch to manual mode causing problems.

@sgynn
Copy link
Author

sgynn commented Apr 12, 2019

I think the parent transform of root bones may also be broken in this case.
After setting the bones back to non-manual after this bug occurs the root bone derived transform is completely off.

@darksylinc
Copy link
Member

Hi!

Is there a quick repo? (i.e. editing AnimationTagPoint sample?)

I think I see what you mean as setManualBone() depends on boneTransf.mIndex.

Thus we should probably reset in either SkeletonInstance::_updateBoneStartTransforms or Bone::_memoryRebased or a new function.

But it would be great to be able to repro in order to check the fix works.

@sgynn
Copy link
Author

sgynn commented Apr 15, 2019

I don't have the samples easily buildable, but it should be reproducible if you create many items of the stickman mesh in that sample then delete 100 of them to trigger the cleanup. Just not a continuous 100 as that is divisible by 4 which may not change the transform indices.

@sgynn
Copy link
Author

sgynn commented Apr 16, 2019

I verified what I was seeing in my first comment was just an effect of the manual mode being wrong - it was causing a different skeleton instance to mess with the transforms of the first.

@sgynn
Copy link
Author

sgynn commented Apr 18, 2019

Found another thing broken by the bone memory manager cleanup.
SkeletonAnimation::_initialize uses the SkeletonInstance mSlotStarts list to set up the mBoneWeights blocks. The function sets some of the weight values to 0 in blocks it only uses half the slots of. These can also end up being incorrect after a cleanup.

@paroj paroj transferred this issue from OGRECave/ogre Sep 1, 2019
@darksylinc
Copy link
Member

This bug took a long time to fix, but it finally arrived.

Applied the fix to all branches (2.1,2.2, and 2.3 / aka master)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants