Jump to content

Fallback to CPU Skinning?


Keslinger
 Share

Recommended Posts

Hi,

I'm playing with a wearables system to load clothes pieces and associate them with a baseMesh's skeleton (not unlike the XBox avatar stuff).

http://babylonjs-playground.com/#WDMRY#23

There should be two models, one clapping and one cheering.  They should be wearing different wearables (loaded during runtime and set via wearableMesh.skeleton = baseMesh.skeleton)

I've run into a weird issue on devices that run out of uniforms for skinned models.  Works great on my desktop (Chrome), but on my Nexus 6, I see shader compiler errors and messages that say it will fall back to CPU skinning.  The CPU fallback doesn't work, though.  The end result is the skeletons are not associated properly with the skinned mesh pieces (wearables). Which parts are wrong varies from load to load.  The same thing happens on other mobile devices that have to fallback.

I understand that I can reduce the number of bones in a mesh to ensure I take advantage of GPU skinning (and I will eventually), but CPU fallback should work, right?  Is there something else I'm doing wrong? 

Thanks!

 

Edit:  A much cleaner example, just loading the same file twice

http://babylonjs-playground.com/#1XQ32V

 

Edited by Keslinger
Added cleaner example
Link to comment
Share on other sites

After some more documentation spelunking...

If I iterate through all the meshes and set "computeBonesUsingShaders = false" for each mesh, it skins properly on mobile.  How do I know (programmatically) when I should do that and when it's okay to use the shader?  

Link to comment
Share on other sites

Haha.. you researched, merged and deployed faster than I could figure out what property of the engine contained the version.  Too cool.

Yup, that fixed it!  Thanks!

Hmm.. still... Is there a way for me to know if the engine had to fall back to CPU?  I think (one day) I'd like to notify the user, swap assets, etc. if I know they are on a lower end device.

Thanks again.  

 

 

 

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...