Skip to content

How to animate uniforms for a shader? #1042

Answered by wcandillon
cdosborn asked this question in Q&A
Discussion options

You must be logged in to vote

Uniforms support Skia values. Could it be that you assign the value as a map value instead of the whole property?

const uniforms = useComputedValue(() => ({ time: clock.current }), [clock]);
return (<Shader source={source} uniforms={uniforms} />);

I hope this help.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cdosborn
Comment options

Answer selected by cdosborn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants