Jump to content

  • Log In with Google      Sign In   
  • Create Account


TRONJon

Member Since 06 Mar 2014
Offline Last Active Sep 08 2014 07:02 AM

#5157294 Correctly parse Skeleton info from COLLADA file

Posted by TRONJon on 01 June 2014 - 04:33 AM

Hello, I had to tackle the COLLADA problem a month ago, so I can offer my experience :)

 

I have 5 structs which work together:

COLLADA - The main class holding everything together, contains arrays and methods to use the following classes...

MESH - The class containing the vertices, texture coords, faces, and a method to render them

CONTROLLER - Reads the matrices for binding and skinning

ANIMATION - This simply contains the animated matrices and methods to bind them to a skeleton

BONE - A simple class with 2 matrices, a local matrix, and a world matrix. These have children bones and a parent bone.

 

Now, to the vertex weights -

 

Every vertex is bound to 1 or more bones, so <vcount> is actually bone count per vertex, the following:
1, 3, 1, 2, 3, 4, 1, 2

would mean the first vertex in the mesh is bound to 1 bone, the second vertex is bound to 3 bones, etc

and <v> is the actual data for that binding, using the counts listed above, <v> would be layed out like:
[vertex 1: boneindex, bone weight]

[vertex 2: boneindex, boneweight,      boneindex, boneweight,       boneindex, boneweight]

[vertex 3: boneindex, boneweight]

[vertex 4: boneindex, boneweight,     boneindex, bonewieight]

Etc.

 

I hope I could help. My skype name is on my profile name if you need any more help!

 

 - Jonathan




#5149895 SPEED: glUniform Vs. uniform buffer objects.

Posted by TRONJon on 27 April 2014 - 11:20 AM

So recently I dropped all support for legacy openGL matrix functionality from my 3D engine, and instead of GL_MODELVIEW for example, I'm uploading my view matrices to a Uniform Buffer Object to be shared and accessed by my shaders. But as stated in a previous post, this caused a huge FPS drop (from 1000 to 100). I've managed to get this number up towards about 400 by trimming out as many matrix calls as possible (like transforming meshes before drawing, I've now transformed the vertices before uploading to the GPU), but I'm still not happy with the performance.

 

Would regular glUniform calls be quicker than using buffer objects, for example, when I bind a shader, I pass the current view/projection matrices as a uniform, rather than using the UBO's.

 

This would mean each shader would have it's own copy of the matrices rather than the global (UBO) ones...

 

Does anyone know if glUniform() calls are faster than UBO calls? (Which have proven to drop FPS quite significantly).

 

Jonathan.




PARTNERS