playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.66k stars 1.35k forks source link

Feature Request - Dual Quaternion Skinning #3643

Open JesperCJ opened 2 years ago

JesperCJ commented 2 years ago

We are a team, doing research on the animation pipeline for the next prototype. This time, we are doing some muscle'y strong guys. And during some of my rigging and testing, I found that, when twisting arms espescially, these buffed guys almost "fall apart", due to "candy wrapper" issues arising, when twisting limbs.

Muscles basically "dissapear", and arms get much thinner. The workaround for now, is adding some twistbones (not too many of course), but it would be awesome to get an idea of where you guys are going (if at all) with the idea of adding Dual quaternion skinning - to minimize wolume-shrinking as a reault of twisting limbs on characters.

Here's an explanation of the issue: https://www.youtube.com/watch?v=4e_ToPH-I5o

Here's an example of twisting the arm of this strong guy (extra twistbones help remove part of the candy wrapper issue). Look at the end of the gif - here, you can see how dual quaternion skinning helps keep more of the musclevolume.

GIF 29-10-2021 13 53 06

Best, Jesper Colding

willeastcott commented 2 years ago

Is this something you know about @mvaligursky?

mvaligursky commented 2 years ago

In my past projects, we've always just handled it with extra bones, but it certainly is a viable solution. We'd most likely need to support both options, as dual quaternion is not always a better solution, see here: https://github.com/mrdoob/three.js/issues/20324#issuecomment-922460747

JesperCJ commented 2 years ago

Thanx for the input. I would always go for "the less bones, the better". Helperbones, to fix skinning issues, are fine, when doing stuff for movies. But for games, I would prefer rigs, that are as simple as possible, and there, DQS is a big helping hand, even though in some cases, it might be a tad more processing intense.

And, as the guy, your'e referring to, ends his post:

"If DQS will allows for a much quicker and pain free design and weight painting of your rig, you need to build your rig with DQS in mind for optimal results

That being said simple models without helper joints and not too smushy skin will definitely benefit from a switch over to DQS."

So, our team would really like to push for this feature. Thanx, Jesper Colding