GameMonetize Posted August 7, 2015 Share Posted August 7, 2015 Hey team, I've just introduced a new property for meshes: mesh.computeBonesUsingShaders By default this value is true, indicating to Babylon.js that you want to use shaders (And thus GPU) to compute bones animations. The only drawback is that this operation can consume a lot of shaders uniforms (a limited resources representing the variables that can be sent from the CPU). On low-end devices this may be a problem as bones can swallow all the uniforms. So you can now decide to use the CPU (beware to use it wisely) if you want to. adam 1 Quote Link to comment Share on other sites More sharing options...
MasterK Posted January 13, 2016 Share Posted January 13, 2016 look at the Christmas old man, // Software skinning for (var softwareSkinnedMeshIndex = 0; softwareSkinnedMeshIndex < this._softwareSkinnedMeshes.length; softwareSkinnedMeshIndex++) { var mesh = this._softwareSkinnedMeshes.data[softwareSkinnedMeshIndex]; mesh.applySkeleton(mesh.skeleton); } it has 75 bones, so it use cpu to compute bones. when i remove mesh.applySkeleton(mesh.skeleton); it looks as the first screenshot, use mesh.applySkeleton, it looks as the second screenshot, the depth is orderless... Quote Link to comment Share on other sites More sharing options...
MasterK Posted January 13, 2016 Share Posted January 13, 2016 set this all mesh. computeBonesUsingShaders = false; looks worse... nvniuzai.babylon Quote Link to comment Share on other sites More sharing options...
chg Posted January 13, 2016 Share Posted January 13, 2016 If it's all flat sprite/billboard geometry why are you using skinning and storing all the layers (quads?) as parts of a single mesh with different bone weights? This seem horribly inefficient. When you said you needed 32+ bones I assumed you'd have a very detailed character mesh with many points of articulation - and even then I questioned why you didn't divide it into sub-meshes as a workaround. It might seem like skinning works like 2d tools like Spine but the necessity of weighting each vertex means way more work is taking place then you need. If it's all 2d quads being positioned (uniformly rotated, scaled, and translated in space) I think you need a sprite batch (if you must handle all the geometry in a single draw call) Quote Link to comment Share on other sites More sharing options...
MasterK Posted January 14, 2016 Share Posted January 14, 2016 yes.... it's from spine things...a 2d game, and we need to turn it into babylon.js, then the art use 3dmax to make same thing of it. (maybe it's the most convenient way...) i dont know how to divide it into sub-meshes... and i dont understand bone weights... use sprite batch should make a tool first... too hard... Quote Link to comment Share on other sites More sharing options...
max123 Posted October 28, 2016 Share Posted October 28, 2016 On 8/7/2015 at 6:41 PM, Deltakosh said: Hey team, I've just introduced a new property for meshes: mesh.computeBonesUsingShaders By default this value is true, indicating to Babylon.js that you want to use shaders (And thus GPU) to compute bones animations. The only drawback is that this operation can consume a lot of shaders uniforms (a limited resources representing the variables that can be sent from the CPU). On low-end devices this may be a problem as bones can swallow all the uniforms. So you can now decide to use the CPU (beware to use it wisely) if you want to. I get an error when I set this property to true: Uncaught TypeError: mesh.applySkeleton is not a function Scene._renderForCamera @ babylon.2.5.max.js:17989 Scene._processSubCameras @ babylon.2.5.max.js:18116 Scene.render @ babylon.2.5.max.js:18270 (anonymous function) @ main.js:386 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.