Baker Xiao Posted September 17, 2017 Share Posted September 17, 2017 A weird problem again... a repro can be seen here: https://www.babylonjs-playground.com/#0A74HT. Playing this PG on android chrome, or desktop browsers, you will each character doing a different animation. However if you play this on iphone, all characters will be playing the exact same animation always. Any theories? Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 18, 2017 Share Posted September 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2017 Share Posted September 18, 2017 Can you check with this scene and see if the rabbits are playing different animations? https://www.babylonjs.com/demos/bones/ Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2017 Share Posted September 18, 2017 And I think that @Wingnut is on the right way. To be sure can you just run this one as well: https://www.babylonjs-playground.com/#0A74HT#1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 18, 2017 Share Posted September 18, 2017 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. Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 18, 2017 Author Share Posted September 18, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 18, 2017 Share Posted September 18, 2017 The root problem is that you may have too much bones for some mobiles. Babylon.js will then fallback to software skeletons which require having unique geometry Baker Xiao 1 Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 19, 2017 Share Posted September 19, 2017 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. GameMonetize and Baker Xiao 2 Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 20, 2017 Author Share Posted September 20, 2017 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. Quote Link to comment Share on other sites More sharing options...
gryff Posted September 20, 2017 Share Posted September 20, 2017 @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 Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 21, 2017 Author Share Posted September 21, 2017 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. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted September 21, 2017 Share Posted September 21, 2017 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. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Baker Xiao Posted September 22, 2017 Author Share Posted September 22, 2017 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! 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.