-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
WebGLRenderer: Add support for morphing colors. #23523
Conversation
@AleksandarCebov We can only add support for |
That is also fine. As much data that can consume as possible. |
Great work, and thanks @Mugen87 and @AleksandarCebov! Thoughts, in no particular order ...
tl;dr — We'd be stepping out a bit "in front" of the ecosystem by adding this feature before real workflows exist. There are times when that's a good thing to do, so I'm not opposed to adding this, but just want to be sure we're aware of both the implications and alternatives. |
We actually used morph colors in http://www.ro.me/ to morph between animals 🤓 So we actually used to support this, but I think I removed it because the implementation was way too messy. The implementation in this PR is nice and it also cleans up the code around it 💆♂️ |
Thanks! |
Didn't know ro.me used this method! Do you recall what the Blender workflow was? I guess it was using three.js' custom Blender exporter at that point... I could hook something up with glTF Transform to support this, using steps like...
|
Yes, we had a bunch of python scripts I think. |
Just tested this out, working other than a minor issue fixed in #23654!
morph-color-anim.movThis script doesn't yet support sparse accessors, which would save a lot of space when only some of the vertices are re-colored. |
* WebGLRenderer: Add support for morphing colors. * WebGLMorphtargets: Simplify code. * WebGLRenderer: Make morph color check more safe.
Related issue: #23467
Description
This PR adds support for morphing vertex colors. Meaning having
geometry.morphAttributes.color
is now valid.The PR also ensures that
GLTFLoader
can load assets which define morph targets forCOLOR_0
.The new feature is only supported with WebGL 2 since the implementation requires the morph texture for managing the data.