Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: Skinning

  1. #1
    Intern Contributor
    Join Date
    Oct 2010
    Posts
    60

    Skinning

    How to make skinning when there are more than 4 bones per vertex?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,732

    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.

  3. #3
    Intern Contributor
    Join Date
    Oct 2010
    Posts
    60

    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 ?

  4. #4
    Senior Member OpenGL Pro Ilian Dinev's Avatar
    Join Date
    Jan 2008
    Location
    Watford, UK
    Posts
    1,261

    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
  •