Jump to content

Hardware Skinning


MangoFusion
 Share

Recommended Posts

I've been working on a Hardware Skinning branch ( https://github.com/jamesu/Torque3D/tree/ts_hw_skinning_mk2 ). This implements hardware accelerated skinning via a vertex shader. Summarizing the capabilities...


* Skins with 4x3 matrices allowing for around ~70 active bones in DX9

* Allows for 4 or more bones per vertex (limited by how many attributes you can pack into a shader)

* Up to 255 addressable bones per mesh (subject to API limits)

* Can fallback to software skinning.


There's currently a problem with mixing rigid and skinned meshes (really need to use separate or offsetted buffers here), and also a weird issue with the first person weapon model. Hopefully should get these issues fixed soon ready for a PR.

Link to comment
Share on other sites

  • 2 months later...

Have you thought about using stream out? I have a real issue with vertex shaders doing skinning in that they just tend to be inefficient (for a number of reasons). Using a stream out system would mean that;

 

  • The vertex shader pipe-line is the same for all mesh types, reducing overall code complexity
  • The vertex shaders and vertex formats tend to be simplified, reducing the number of render state and shader changes during rendering
  • No need for multiple draw calls for single mesh due to constant/constant buffer limitations (there's also a caching cost on constant buffers)

 

Anyhow...even if you hadn't though if it; excellent work. I've been looking through the render pipe-line and my first thought was "aye caramba!". It's a clever person who can look into the eye of that beast and do something productive!

Link to comment
Share on other sites

Hey man, had you had any progress on this, or were the current problems still stonewalling you? I want to get this in for 3.8 if at all possible, so if you wanted to crack heads with me to try and get this ironed out, I'd be pretty game on it.


So far I've had 2 noticable problems. The '$nodeTransforms' parameter is unassigned issue(which oddly I see more triggered in the glow bin manager than anywhere else) and the 2d first person weapons.

Link to comment
Share on other sites

First person weapon models are still a complete mystery.I'm currently refactoring the vertex buffer code so it uses a single VBO and also to solve the nodeTransforms issue.

Given that when I last tested it, the pistol (and only the pistol) was a squashed plane, wouldn't be surprised if that fixed the first person thing.

Link to comment
Share on other sites

  • 6 years later...
On 4/15/2015 at 2:07 AM, JeffR said:

Hey man, had you had any progress on this, or were the current problems still stonewalling you? I want to get this in for 3.8 if at all possible, so if you wanted to crack heads with me to try and get this ironed out, I'd be pretty game on it.

 

So far I've had 2 noticable problems. The '$nodeTransforms' parameter is unassigned issue(which oddly I see more triggered in the glow bin manager than anywhere else) and the 2d first person weapons.

So... to revamp a dead thread. Did we get this into the 3.8 version 😁

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.

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.

 Share

×
×
  • Create New...