Baker Xiao

cloned skeletons animate incorrectly only on iphone

Recommended Posts

Hi BX.  I'm not an expert at all, but there has been "forum talk" about bone limits on mobile devices.

I'm not sure if it applies, but perhaps...

http://www.html5gamedevs.com/topic/19796-skeleton-bones-limit/

Search the forum carefully.  I'm sure I have seen others talking about similar issues.  Others will likely comment soon.  Sorry I didn't have more answers.

Share this post


Link to post
Share on other sites

I see the same thing on iOS.  @Baker Xiao turn on your playground debug layer.  My guess is that for instances, it is trying to accomplish this in 1 draw call.  This is bad news for iOS which uses the minimum for the # of uniform buffers.  It also does not support WebGL 2, so no uniform buffers.

The console has the uniform limit was hit & is was falling back to CPU skinning.  Now perhaps this is a problem there.  I know the only time I touched that, someone had to fix it later, so no opinion if anything can be done.  Best not to use instances & skeleton at the same time, if targeting mobile.  Android only allows double the minimum, at least on my hardware & chrome.

@Deltakosh, I have a better handle of the scrolling problem of  debug / console on iOS.  I said it wasn't working on one earlier topic.  On the Github issue, I said it was.  The story is, if a fallback is involved, the text of all the shader source wraps and I guess keeps the field from scrolling. 

Share this post


Link to post
Share on other sites

Thanks @Wingnut @Deltakosh @JCPalmer for helping!

@Deltakosh making geometry unique fixes the issue! Is that what we should be doing? It fixes the individual animations but some faces on the mesh somehow appear missing... 

@JCPalmer We're not doing instancing though. We are cloning the meshes. Perhaps sharing the same geometry is the underlying cause? 

Share this post


Link to post
Share on other sites

I should have looked at the source.  For iOS the theoretical max of bones is 32, but in practice it is 22-23.  Uniforms other than for bones are going to reduce from the max.  Debug shows you have 41 per skeleton.  Unless there are many tied up in fingers, toes, and face that can be deleted prior to export, it might be better to just start with a different skeleton.

Share this post


Link to post
Share on other sites
12 hours ago, JCPalmer said:

I should have looked at the source.  For iOS the theoretical max of bones is 32, but in practice it is 22-23.  Uniforms other than for bones are going to reduce from the max.  Debug shows you have 41 per skeleton.  Unless there are many tied up in fingers, toes, and face that can be deleted prior to export, it might be better to just start with a different skeleton.

That makes perfect sense. Thanks for the info! We are going to try simplifying the skeleton for mobile. 

Share this post


Link to post
Share on other sites

@Baker Xiao : As an additional thought it does not work in Firefox on my Windows XP machine (I know, I know). It throws this amongst the errors:

#define NUM_BONE_INFLUENCERS 7
#define BonesPerMesh 42

@JCPalmer has explained the max number of bones issue  - but the NUM_Bone_Influencers surprised me given the low poly nature of the mesh ( I normally work with 2-3). How was the rigged mesh created?

cheers, gryff :)

 

Share this post


Link to post
Share on other sites
17 hours ago, gryff said:

@Baker Xiao : As an additional thought it does not work in Firefox on my Windows XP machine (I know, I know). It throws this amongst the errors:


#define NUM_BONE_INFLUENCERS 7
#define BonesPerMesh 42

@JCPalmer has explained the max number of bones issue  - but the NUM_Bone_Influencers surprised me given the low poly nature of the mesh ( I normally work with 2-3). How was the rigged mesh created?

cheers, gryff :)

 

Oh that's good find! Thanks a lot for noticing this. We used https://www.mixamo.com/ to auto rig the model. The algorithm is probably not very well optimized for low poly models. 

I'm not very experienced with this yet, but does the max # of bone influencers have significant impact on performance as well? We haven't noticed anything yet on the mobile devices we are testing with. 

Share this post


Link to post
Share on other sites

From a RAM resource standpoint, having a max of 1-4 all occupy the same space.  5-8 occupy doubles the amount.  The vertex shader will have less work to do with each one less though.  Remember that 5-8 is the double of 2 things:  the indexes to the bones of each vert & the amount of influence.

In the Blender exporter, one of the things I log is the # of vertices requiring the max used.  If say only 9 of 20,000 vertices are using 7, dropping down to at least 6 ( and hopefully 4) during export should give pretty reasonable, if not un-noticable results.  Blender also has its way to do it at the model level, I think, but to 4 is the only option.  Not sure your work flow, but the point is you might search for a place to do it in multiple places.

Share this post


Link to post
Share on other sites
10 hours ago, JCPalmer said:

From a RAM resource standpoint, having a max of 1-4 all occupy the same space.  5-8 occupy doubles the amount.  The vertex shader will have less work to do with each one less though.  Remember that 5-8 is the double of 2 things:  the indexes to the bones of each vert & the amount of influence.

In the Blender exporter, one of the things I log is the # of vertices requiring the max used.  If say only 9 of 20,000 vertices are using 7, dropping down to at least 6 ( and hopefully 4) during export should give pretty reasonable, if not un-noticable results.  Blender also has its way to do it at the model level, I think, but to 4 is the only option.  Not sure your work flow, but the point is you might search for a place to do it in multiple places.

Thanks a lot! This is really helpful! 

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.