Jump to content
  • Advertisement

Recommended Posts

Hello!

I'm starting to do skeletal animations, a few questions have appeared.
1. I noticed that the examples use exactly 4 indexes and weights per vertex. This is due to the attributes in OpenGL. So, do all models have up to 4 indices and weights per vertex? Does it make sense to expand this value?
2. Are there any non-complex but effective tutorials on skeleton animations? If yes, I would appreciate the link.

I will be grateful for the answers

Share this post


Link to post
Share on other sites
Advertisement

I'm no expert here, but 4 weights probably looks good enough in most cases so that became the standard (anything more and you'd probably run out of registers on the GPU with a complex model). I'm about to tackle the same exact issue and my plan is as follows: create something very simple, like a 2D skeletal animation with only 2 or 3 bones (maybe just a piece of grass swaying in the wind), then gradually expand that to full functionality, by making it 3D, adding more bones and loading models, etc. I'm also looking for a tutorial that explain this simply, how to start small, and then gradually build up.

Share this post


Link to post
Share on other sites

 

When I think about it, the only place on a biped that would use more than two weights per vertex would be in the facial regions. Arms, legs, fingers, etc. would not. In a lot of systems I've seen, it's the bone count that needs expanding. Fixing an array size is a pretty good optimization instead of going with a heavier container. I'm not sure the DCC will cap the number of weights. Probably not, so it is possible to overrun the weight count if not handled properly during load or conversion.

There is [ ogldev - tutorial 38 ] but my current go to is this. I ignore that it's java.. 

 

Share this post


Link to post
Share on other sites
2 hours ago, GoliathForge said:

... but my current go to is this. I ignore that it's java.. 

 

2

In these video tutorials how many indexes and weights per vertex?

Share this post


Link to post
Share on other sites

Found this: https://github.com/KhronosGroup/glTF/issues/1275. It turns out that most engines put a limitation on precisely 4. Does it make sense to extend this value to any other, for example using attribute arrays? Will there be a noticeable difference between animation with 4 weights per vertex and animation that has 8 weights per vertex?

Share this post


Link to post
Share on other sites
Posted (edited)

My engine has skeletal animation, done using AssImp to import the data, and a bunch of custom code to render using OpenTK(C# opengl). - if you wish to see it though, i'll upload a zip of the relevant code(It's too big to post in here, i think)

 

Edited by Vivid3DDev
edit

Share this post


Link to post
Share on other sites
3 hours ago, congard said:

Found this: https://github.com/KhronosGroup/glTF/issues/1275. It turns out that most engines put a limitation on precisely 4. Does it make sense to extend this value to any other, for example using attribute arrays? Will there be a noticeable difference between animation with 4 weights per vertex and animation that has 8 weights per vertex?

I think it's the other way around. If your artist comes up to you and says "Hey I need to use more than 4 weights per vertex on my models" then you might consider increasing the limit in your engine but otherwise you would be trying to solve a problem that probably doesn't exist. I believe Blender has its default weight limit set to 4 as well. 

Share this post


Link to post
Share on other sites
11 hours ago, VoxycDev said:

anything more and you'd probably run out of registers on the GPU with a complex model

You most likely won't run out of registers even when using much more weights. There is a way how to support any number of weights per vertex - all matrices will go through structured buffer, and if you would have list of weights per vertex going through another structured buffer - it is technically then just 2 values per vertex (index and count). Then use a for loop (it will be without loop unrolling - as your parameter will vary). This will allow you to use arbitrary number of weights per vertex.

Of course using 4 weights at most will most likely be much better in performance (although this is hard to tell and compare), but in case you require precise animations done the same way as in editor software (in games close up complex animations in cut scenes might be scenario where you require this) - then you can go this way.

1 hour ago, Acar said:

Will there be a noticeable difference between animation with 4 weights per vertex and animation that has 8 weights per vertex?

This depends on your animation, animating muscles, facial animation or similar may require more than 8 weights per vertex.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!