Jump to content

Software skinning


GameMonetize
 Share

Recommended Posts

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.

 

Link to comment
Share on other sites

  • 5 months later...

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

QQ图片20160113155100.png

QQ图片20160113155106.png

 

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

  • 9 months later...
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
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...