Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does glTF support cloth animation? #870

Closed
rootext opened this issue Mar 11, 2017 · 8 comments
Closed

Does glTF support cloth animation? #870

rootext opened this issue Mar 11, 2017 · 8 comments

Comments

@rootext
Copy link

rootext commented Mar 11, 2017

Does glTF support cloth animation?
Are Morph Targets designed for this?
Is there glTF sample model with cloth animation? with Morph Target?

@pjcozzi
Copy link
Member

pjcozzi commented Mar 12, 2017

Morph targets will be part of glTF 2.0, see #852. These could be used for cloth animation, but the asset will be large.

I do not believe there are any sample models yet. @emilian0 do you have any?

@rootext
Copy link
Author

rootext commented Mar 13, 2017

Yes, asset will be large. However, it will be large in any case. For such type animation it is needed to store vertex attributes for each key frame.
It seems that Morph Targets suit well for any type of morph animation including cloth and hair animation (most used in modern games).
However, Morph Targets define delta between a reference mesh and target mesh. Perhaps, it would be useful to directly store target mesh vertex attributes.
Based on my experience, blending isn't always required for cloth animation. Closest key frame in animation loop is just used. I am not an expert here and don't know how cloth animation is stored in AAA titles.

I propose to add ability to define that Morph Target either delta between a reference mesh and target mesh or just target mesh.

@javagl
Copy link
Contributor

javagl commented Mar 14, 2017

I am not an expert here

neither am I, but ...

and don't know how cloth animation is stored in AAA titles.

These games involve some sort of physics engine, and the cloth animation is usually accomplished with a very simple (coarse) mass-spring model (possibly augmented with finer geometry for the wrinkles - there's a lot of papers about this out there). Examples and further information can quickly be found online, e.g. http://www.gdcvault.com/play/1022421/Ubisoft-Cloth-Simulation-Performance-Postmortem

For storing a pre-computed animation, it's not necessary to store all vertex attributes for each frame - at least, the texture coordinates will not change. Positions have to be stored. Normals could be stored or computed, that's a trade-off.

@pjcozzi
Copy link
Member

pjcozzi commented Mar 14, 2017

I propose to add ability to define that Morph Target either delta between a reference mesh and target mesh or just target mesh.

@emilian0 would be the best person to advise here. Would this be widely used?

@emilian0
Copy link
Contributor

Hi @pjcozzi thank you for pointing me to this conversation.
@lexaknyazev and I debated a little in #210 around including both modes Relative and Normalized (Absolute) storage of displacements. The two methods are mathematically equivalent we decided to only choose one method to simplify the implementation requirements. We choose RELATIVE since it has "a lot of zeros" and compresses better than the Normalized method, this said sparse storage #820 should also mitigate the storage overhead in case the Normalized method is chosen. Would it make sense to include the NORMALIZED method as an extension?

@pjcozzi
Copy link
Member

pjcozzi commented Mar 15, 2017

Would it make sense to include the NORMALIZED method as an extension?

If there is enough interest, we can consider this or putting it in core post 2.0.

For now, let's push past 2.0 to control the scope.

@pjcozzi pjcozzi removed the 2.0 label Mar 15, 2017
@rootext
Copy link
Author

rootext commented Mar 15, 2017

@javagl , I see but sometimes 3D artist want to control it precisely in some specific cases.

I've re-read comments from the issue #210. It seems my proposal was already discussed. Now I see good points why it is better to store relative vertex attributes taking into account that gltf is general purpose standard. Let's close this issue.

To my mind, all my questions are answered and we will be able to migrate to gltf 2.0:
We can use Morph Targets to store baked cloth animation.
In our particular case, we will just need to recalculate relative positions to normalized positions.

@pjcozzi
Copy link
Member

pjcozzi commented Mar 15, 2017

Thanks for the input, @rootext!

@pjcozzi pjcozzi closed this as completed Mar 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants