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
Ability to target ShaderMaterial uniforms via animations #28333
Comments
Dug into parseTrackName, bind, and findNode which is where most of the I think it's possible, may try to draft something when I get a chance. |
Did you try this approach?
|
Thanks Mugen!
Yea #25028 would address this. Looking at the code I had lost some of my ambition for fixing every nested property case since it seems easier to address just the case of If you think a PR for #25028 would be approved, we can close this as duplicate and I'll throw some effort to that battle. |
If you want to control the ShaderMaterial uniforms via a specific animation, all you need is a simple function based on
In you case it will be something like |
Thanks so much @RemusMar that's a really cool approach. Honestly it'd be easiest for me to just use TWEEN and call it a day (more flexibility to cycle through non-linear arbitrary values). |
Description
Tried to target arbitrary THREE.ShaderMaterial <float> uniform value with an animation, doesn't work.
Or hacky work-around (also didn't work):
Solution A
Upgrade
THREE.PropertyBinding.parseTrackName()
to support binds tomaterial.uniforms.name.value
. Can we just have a fallback that allows to target any property (no matter how deeply nested) as long as that property exists?Solution B
Hoist a shared reference of all THREE.ShaderMaterial uniform values to the top-level of the material object. This would hoist a reference to uniform values high enough to be targeted by the current animation implementation.
Additional context
I'd imagine solution A is more desirable. Unclear to me if there's a limitation that prevents how deep the animation targeting can reach.
The text was updated successfully, but these errors were encountered: