Jump to content
  • Advertisement

Pilpel

Member
  • Content count

    181
  • Joined

  • Last visited

Community Reputation

563 Good

About Pilpel

  • Rank
    Member

Personal Information

  • Interests
    Art
    Programming
  1. The way I'm doing things right now is: For static meshes, I calculate a "toRootTransformation" 4x4 matrix for every node, based on the hierarchy of the nodes. Then for every node that contains a mesh, I render the mesh with a shader looking like this: #version 430 uniform mat4 ProjectionMatrix; uniform mat4 CameraMatrix; uniform mat4 ModelMatrix; layout(location = 0) in vec3 vertex; layout(location = 1) in vec2 uvs; layout(location = 2) in vec3 normal; out vec2 fsUvs; out vec3 fsNormal; void main() { gl_Position = ProjectionMatrix * CameraMatrix * ModelMatrix * vec4(vertex, 1.0); fsUvs = uvs; fsNormal = normal; } Before that I set the ModelMatrix uniform to that toRootTransformation. For skinning, I upload the bone matrix array uniform to the shader, calculate each vertex position based on it, and multiply by the same "toRootTransformation" as before. Here's the main part of the vertex shader: void main() { vec4 final = vec4(0); for(int i = 0; i < NUM_INFLUENCE_BONES; i++) { vec4 v = Bones[boneIndices[i]] * vec4(vertex, 1.0) * vertexWeights[i]; final += v; } gl_Position = ProjectionMatrix * CameraMatrix * ModelMatrix * final; } Every bone matrix is a multiplication of the bone's inverseBindPos matrix and the matrix that is the product of all the rotations/translations of the bone at the current time, based on the node hierarchy. In code: void Bone::calculateFinalMatrix() { //matrix for the shader _finalMatrix = _animationMatrix * _inverseBindPosMatrix; //_animationMatrix is already calculated by AnimationController } To be honest this is the product of like a week of struggling to get skinning done, and I'm not sure if I'm doing it right. (please correct me if not) The question that I ask myself is why do I need to multiply each bone by the inverseBindPos first. It transforms each vertex from world to local space, before multiplying by the animation matrix. But the thing is that the vertex isn't in world space to begin with, but in local space. So basically we're going from local space to local space (then animating) which doesn't make sense.
  2. Pilpel

    Assimp bones' relation to nodes

    What do you mean? These bones don't exist, as in no aiMesh ever refers to them. Just to be sure, I don't need the mTransformation matrix of the aiNodes anymore when doing skinning, right? Edit: I think I was wrong in the statement above actually. :p Edit2: I'll just start a new topic about that issue, hopefuly you can help me (no spam intended)
  3. Pilpel

    Assimp bones' relation to nodes

    So what's the deal with the nodes that don't have corresponding bones?
  4. I noticed that when importing animated meshes, the total number of bones (aiBone) in the scene might be less than the total number of nodes (aiNode), so my initial thought was "okay their hierarchies are probably not related.. whatever", but then I noticed that an aiBone object doesn't contain a pointer to a parent bone. So my question is how do I calculate the final matrix palette for the bones, not knowing the hierarchy between them? Edit: I forgot to mention that according to some book I read every joint (bone) must store an index to its parent joint.
  5. I'm designing an animation system. I already implemented skinning long time ago (with C++ and opengl) but it was very basic and lacked some important features like blending (e.g. transitioning from walking to running) and playing several animations at the same time (e.g. waving and running). They both might be called "animation blending" but I'm not sure. Anyway, I'm asking for ways to implement all these things. One thing I have to figure out is when for example the character is running, he obviously moves his upper body, but say if I want to add a "waving hello" clip while he is running I'll probably have to somehow tell all the upper body bones to ignore the running transformations (just a thought).
  6. Suppose I have an animation clip of a character waving his hands, and another clip of the same character running. What approaches exist that allow me to implement such a thing? (talking about skeletal animation)
  7. Haha. My piano teacher told me there is no shame in copying from good pianists, so I thought about doing the same here. Thanks
  8. I've read many tutorials on opengl and how to render neat stuff but I can't find any article on how to merge all these techniques together into an "engine" or a "renderer". My thoughts is that finally I need to have this 3d renderer, physics engine, sound, network etc all connected with an "Engine" class, so right now my question is how does the renderer work (where do I put the shadow mapping code, culling etc.). I'm pretty clueless so any piece of information will be great
  9. Pilpel

    Is MSAA affected by drawing order?

    This only happens inside a triangle, right?
  10. Pilpel

    Is MSAA affected by drawing order?

    I'm not sure if I get it. Does MSAA differ from SSAA in a way that the pixel shader is ran, most of the times, fewer times per pixel? Memory usage (number of elements in the color buffer) seems to be the same for both MSAA and SSAA, no?
  11. Pilpel

    Is MSAA affected by drawing order?

    So SSAA and MMAA have the same memory usage?
  12. Pilpel

    Is MSAA affected by drawing order?

    If it stores N times more colours, how is it different that SSAA?
  13. I've read that in MSAA each pixel's final color is an interpolation of its current color and the triangles color, depending on how many samples the triangle is covering. That means that when drawing the scene in different orders affects the "current color" I mentioned above. So if I draw the scene in different orders when using MSAA, will the final render image be affected by this?
  14. After the modeler creates a physics object of the model he made, how is it loaded into Bullet?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!