Bones - Skeletal and Pose Animations for jPCT/jPCT-AE > Bones

Has anybody implemented GPU/vertex shader bones yet?

(1/4) > >>

Redman:
I am curious to see if anybody has implemented GPU bones Shader yet and if they would be willing to share.  I see it mentioned in past topics, but no solution.  In the meantime, I will try to write one and share it if I'm successful.

I can't continue my project without it as my frame rates drop dramatically if I call animateSkin(...);

Thanks.

raft:
how many polygons is your model?

as you had said, there was some work on that but nobody published anything as far as I know.

also beware, although HW animation with a shader is possible and will increase the performance, polygon level collision detection will not work in software as software will not be aware of updated mesh.

Redman:
My model is about 500 polys and there are about 20 bones in the model.  If I add 20 animated models, the framerate drops to about 8-9 fps using a Droid Turbo 2.  Without the animation, the rendering stays at the 60fps cap.

Thank you for the note on the software / hardware, as that obviously would be affected.  Bounding box calculations, etc...  Thankfully I don't need to worry about any of that for what I'm working on.

I started working on moving the processing to the GPU, but it's going to take me a little time as I only get about 1 hour to myself at night and I'm not familiar with direct OpenGL commands.  But I will publish what I create with a "use at your own risk" stipulation.

It looks like I'm going to need to alter the JPCT core code itself for what I want to do.  I'm going to let the bones software handle the skeleton bone matrix transformations, and then pass in transform Matricies to the shader on every frame (what Bones calls the currentPosePalette).  Should just be 1 per every bone used.  The data for the weights and jointIndicies is going to be more troublesome for me as I would like to just have the shader use the weight and jointIndices as an attribute float[4] & int[4] based off the index of the vertex being processed.  I need to read up and do a little research.  Please feel free to drop me suggestions.

As a side-note, I have separated out the processing of the bone matrix transformations on every frame for the 20 models, and it keeps the framerate at 60.

More to follow...

raft:
you can go for a hybrid solution. i.e. using skeleton animation create jPCT's regular mesh based key frame animations on the fly and use that afterwards. this will increase performance but you may hit memory limit (depends on number/length of your animations)

Redman:
I have implemented a hybrid solution off-loading all of the per vertex calculations to the GPU, and it runs great.  My device is keeping at the 60-62 fps cap animating 20 models on the screen (as opposed to 8-9 fps).

I have a little clean up to do with my code and then I will post the solution.  You don't need to alter the Bones or JPCT library, but you do need to add a couple helper classes using their namespace in order to access namespace restricted variables/methods.

More to follow.

Navigation

[0] Message Index

[#] Next page

Go to full version