-
Skinning
How to make skinning when there are more than 4 bones per vertex?
-
Senior Member
OpenGL Guru
Re: Skinning
Use more than 2 vec4 vertex attributes for your bone weights and indices.
Though really, there's little actual need. If during the processing of the mesh, you simply remove all the smallest weights beyond the limit of four (per-vertex), I'll bet that your modelers will never even notice you did it.
-
Re: Skinning
I understand, but I am dissatisfied with a moment that if in my mesh there are a maximum number of weights by 2, I must add in each vertex 2 or more zero floats.
I have two attribute buffers: one is numbers of bone matrices and one for weights.
It is a good and simple method, but may be somebody know another one ?
-
Senior Member
OpenGL Pro
Re: Skinning
If storage requirements are your problem, then use this feature:
if at glVertexAttribPointer you specify size=2 instead of 4, the attribute will be vec4(x,y,0,1). The {0,1} are auto-filled for you. If you have 3 weights, specify vec3(weight1,weight2,weight3). If you have 4 weights, specify vec4(weight1,weight2,weight3,1.0-weight4). In the shader, auto-fix the .w component.
Still, imho shoving/compressing everything into 2*4 unsigned bytes instead of 2*4 floats - is enough. Artists don't have really precise control over weight values, and bonesCount>256 isn't common.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules