Skip to content

Add glTF morph animation support (PoC) #16096

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

appgurueu
Copy link
Contributor

This implements support for glTF morph animations.

This gives you an alternative way to animate vertices and normals (technically you could achieve this by having one joint per vertex, but for all but the most low-poly models that would be absurd).

Perhaps more interestingly, this lets you animate texture coordinates. (To give one example, this could be used to define a smooth clientside tile animation inside model files.)

It could also be applied to colors (which could enable cool effects, think rainbow or fake shine), but (1) we currently abuse colors for lighting and (2) our unsigned color format is currently unsuitable for storing the color deltas gltf demands.

Demo:

Screencast.from.2025-04-29.02-43-32.mp4

To do

This PR is a Work in Progress. Some TODOs are in-source / in commit messages.

How to test

Throw models using morph animations at it.

Some things to look at:
- Normal recalculation for vertex morphing
- Bounding boxes (esp. after rebasing this upon the other PR)
@appgurueu appgurueu added Feature ✨ PRs that add or enhance a feature @ Client rendering labels Apr 30, 2025
@appgurueu appgurueu marked this pull request as draft April 30, 2025 18:50
@kromka-chleba
Copy link
Contributor

kromka-chleba commented Apr 30, 2025

Perhaps more interestingly, this lets you animate texture coordinates. (To give one example, this could be used to define a smooth clientside tile animation inside model files.)

This would be especially useful for animating facial textures. Will this need SSCSMs given the "clientside" nature you mention or will there be server-side API to control this too?

@appgurueu
Copy link
Contributor Author

This would be especially useful for animating facial textures. Will this need SSCSMs given the "clientside" nature you mention or will there be server-side API to control this too?

Right now it's just a model feature, these are just normal animations you'd set with ObjRef:set_animation.

@appgurueu appgurueu mentioned this pull request Jan 27, 2025
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client rendering Feature ✨ PRs that add or enhance a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants