Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualnonoptimalrobot

Posted 28 August 2013 - 12:42 AM

[...]
Now when I animate the character in the vertex shader I need to send the bone transforms which is a lot of data. I may need to make multiple draw calls for all the different pieces and I want to avoid sending all bones every time if I only need to send maybe the fingers for the characters glove.

[...]

 

The skeleton is just a big list of matrices or quaternion-translation pairs that are usually stored in a constant buffer.  "Sending the bone transforms" is just a matter of updating a GPU resource; this only needs to happen oncer per frame.  To use that data you simply bind it to the GPU, this isn't free but it's generally very cheap as it doesn't involve moving data from the CPU to the GPU.  After binding the resource the shaders evoked by subsequent draw calls will have access to the skeleton data.

 

Generally speaking you should pack your entire skeleton into a single resource and update it once per frame regardless of how many draw calls it will take to render the skinned mesh.


#1nonoptimalrobot

Posted 27 August 2013 - 08:31 PM

[...]
Now when I animate the character in the vertex shader I need to send the bone transforms which is a lot of data. I may need to make multiple draw calls for all the different pieces and I want to avoid sending all bones every time if I only need to send maybe the fingers for the characters glove.

[...]

 

The skeleton is just a big list of matrices or quaternion-translation pairs that are usually stored in a constant buffer.  "Sending the bone transforms" is just a matter of updating a CPU resource; this only needs to happen oncer per frame.  To use that data you simply bind it to the GPU, this isn't free but it's generally very cheap as it doesn't involve moving data from the CPU to the GPU.  After binding the resource the shaders evoked by subsequent draw calls will have access to the skeleton data.

 

Generally speaking you should pack your entire skeleton into a single resource and update it once per frame regardless of how many draw calls it will take to render the skinned mesh.


PARTNERS