Jump to content

  • Log In with Google      Sign In   
  • Create Account


setting up a VBO for Animation


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 greenzone   Members   -  Reputation: 672

Like
0Likes
Like

Posted 21 June 2012 - 07:09 AM

Hello I am trying to get a skeleton animation to work but i am having some trouble setting up my vertex buffer for this. I have a struct for my vertex that reads as such

struct Vertex {
Vec3 VertsPos;
Vec3 Norms;
Vec3 texCoords;
Vec3 boneWeight;
int boneIndex;
};

How would I set up the vertext buffer using opengl 3.1+ so that this struct is interleaved into the vbo with proper padding. also what would the correct gl draw call be?
J-GREEN

Greenpanoply

Sponsor:

#2 Ashaman73   Crossbones+   -  Reputation: 7206

Like
1Likes
Like

Posted 22 June 2012 - 01:04 AM

Just some notes on your vertex structure:

struct Vertex {
Vec3 VertsPos;
Vec3 Norms;
Vec2 texCoords; //most of the time you only need 2 texture coords
Vec4 boneWeight;// try to utilise a whole register ,that are 4 weights
int boneIndex[4];//the number of weights and bone indicies should be equal
};

I'm still not using OGL3.1, but in OGL2.1/GLSL 1.4 I would declare equivalent attributes like this in the vertex shader

attribute vec3 VertsPos;
attribute vec3 Norms;
attribute vec2 texCoords;
attribute vec4 boneWeight;
attribute ivec4 boneIndex;

Edited by Ashaman73, 22 June 2012 - 01:08 AM.


#3 greenzone   Members   -  Reputation: 672

Like
0Likes
Like

Posted 22 June 2012 - 01:31 AM

Ashaman73, thanks that helps very much Posted Image
J-GREEN

Greenpanoply




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS