mosra / magnum

Lightweight and modular C++11 graphics middleware for games and data visualization
https://magnum.graphics/
Other
4.77k stars 438 forks source link

Complete animation support #101

Open mosra opened 9 years ago

mosra commented 9 years ago

This is one thing I wanted to do since the very beginning. I'm slowly implementing various bits here and there. Making this public so we can track the (non)progress better and to have a list of requirements in case someone is willing to help.

Example opportunities:

More ideas:

Squareys commented 9 years ago

Very nice, I'd really like to see this in Magnum, too!

Question -- should I give this more priority than Vulkan support (#91) or not?

As long as Vulkan is not really released yet, obviously not, but I definitely agree with you that Vulkan support would be a huge attraction to possible new users. And with these new users, there might be someone who has time and motivation to focus on implementing this TODO list. Whereas implementing Vulkan takes alot of wide-spread knowledge and insight of the engine, which makes it hard task for anyone other than yourself. (Also, I believe you would have more fun implementing Vulkan support than animation support. )

mosra commented 9 years ago

@Squareys: I might actually have more fun with animations, Vulkan will require a lot of boring iterations in the beginning to get into some useful shape first (and lots of boring reading/learning). But yeah, you're right, implementing Vulkan support would be very hard for anyone that doesn't have deep insight into design of this engine, animations not so much.

Squareys commented 9 years ago

In addition to the paper mentioned in "Dual quaternion linear/spherical interpolation" (which discusses dual quaternion linear (and iterative) blending and screw interpolation (ScLERP)), this paper also suggests a method to compute screw parameters for screw interpolation.

wivlaro commented 9 years ago

I would vote for Animations over Vulkan. Animations would benefit people using the library and make it more appealing. Vulkan is good, sure, but I don't think it would make such a huge difference as having more animation support.

VinnyVicious commented 8 years ago

One thing that would be really amazing is a small interpolation example along the lines of Overgrowth's techniques: http://www.gamasutra.com/view/news/216973/Video_An_indie_approach_to_procedural_animation.php

Blending between only two keyframes at a specific time, producing a realtime animation.

wivlaro commented 8 years ago

:+1: Great presentation!

mosra commented 8 years ago

@VinnyVicious to be frank, I thought it's always done like this :) having two, maybe three keyframes defined for each animation "clip" with some specific interpolation curve in between and then (automatically) combining all those interpolated poses together .. or am I missing something?

VinnyVicious commented 8 years ago

@mosra, usually, i just do the entire animation in Max and export the FBX containing it. And then play it in the engine. This leads to issues known as players skating, etc.

Does magnum have a builtin way to interpolate stuff? A small example with different curves? :dancers:

wivlaro commented 8 years ago

Yeah. It's much more common practise to just have animators do all the work and then probably use a bit of blending in the engine. Some games go further, but you'll often find that artists want more control than the engineer has time. :dancer: ... but not that this is the way it SHOULD be... :)

VinnyVicious commented 8 years ago

I wanted to get rid of the skating issues and also handle edge cases, like the jump technique. Everything is much more fluid using this Overgrowth technique. I can do more poses in Max and just ask the engine to work on the cue points based on player input.

Since i'm not very good when it comes to 3D math, i'm looking some examples on the subject. :surfer:

klaussilveira commented 8 years ago

A good place to start learning more about IK is this CCD study: http://graphics.ucsd.edu/courses/cse169_w04/welman.pdf. This is also good: http://www.cs.cmu.edu/~./15464-s13/lectures/lecture6/IK.pdf

mosra commented 8 years ago

I think this could define the scope of initial "ready to use" animation support pretty well: http://the12principles.tumblr.com/

mosra commented 7 years ago

Forgot to mention that Beziers were added in 6b7097497fd7938dd0aab7baf222e848eee99287 (#165).

mosra commented 7 years ago

And I guess I could also publish my Animation braindump that I did a few months ago: https://gist.github.com/mosra/0ff8443d623cc0b09efb7a7299a0f692

mosra commented 7 years ago

More to add to the Disney 12 principles: https://twitter.com/jrcanest/status/788441769864073216

mosra commented 7 years ago

Stuff's being baked in #191.

mosra commented 6 years ago

More animation examples: https://twitter.com/DavitMasia/status/1023862760789225472

VinnyVicious commented 6 years ago

Amazing work!

mosra commented 6 years ago

Initial animation support merged in #191 and mosra/magnum-plugins#46.

mosra commented 6 years ago

Spline interpolation, Cubic Hermite, Catmull-Rom, TCB and other splines are being done in #267.

mosra commented 6 years ago

267 with basic Cubic Hermite splines support needed for glTF import is merged, Cat-Rom and TCB conversion together with forgotten slerp() overloads is postponed to later.

mosra commented 6 years ago

Lots of great examples here: http://foxcodex.html.xdomain.jp/index.html

mosra commented 5 years ago

Easing is implemented in c98a936b413ffeb9e13974b9822118b532780b45 (docs).

pixelblender commented 4 years ago

any plan to support ozz-animation (https://github.com/guillaumeblanc/ozz-animation) for skeletal animation maybe via integration? also seems like magnum-examples doesn't have skeletal animation example yet?

Squareys commented 4 years ago

@pixelblender I just recently got skeletal animation working with Magnum, all the pieces are there, but there's no example, no, and you have to write your own Skinning shaders.

mosra commented 4 years ago

Just for the record: some pieces for skeletal animation were recently integrated in e8b64544df49ecc92ff3750236e1975c13e23ea4, d7a4f3bacdf58ee97fe0c7ce03662e68edfb9bdf, 8c24ea19d3504fc96440147b4d66004638ef7290 and mosra/magnum-plugins@31fd4f11dc809ebb0a2154427e5d659037cbbaa6. Initial bits for shader support are in #444 and #441, I still need to finish and merge those (and then there will be an example as well).

VinnyVicious commented 4 years ago

That's awesome! Do you think an example with a character could be added so it's easier to implement?

PierceLBrooks commented 11 months ago

Is there any intention to eventually support automatic vertex group weight assignment algorithms such as "Bone Glow"?

mosra commented 11 months ago

Oh, that's cool -- didn't know such algorithms even were a thing. Yeah, why not, that'd be something to go into MeshTools I think.

Unfortunately I don't have time to implement that myself anytime soon, so contributions welcome :)

PierceLBrooks commented 11 months ago

The two closest things I've found on GitHub so far for skinning work are https://github.com/meshonline/Surface-Heat-Diffuse-Skinning & https://github.com/JSandusky/Urho3DProcGeom