How to create a shader which uses current clock time to animate #3132
Replies: 2 comments
-
Just to clarify, I was expecting iTime to be always present based on docs i have seen on skia but no matter how I populate the uniforms it doesn't seem to work. The shader compiles and runs but the expected effect of time on time calling 'sin' for example is not being seen. It seems as though the uniform is constant and not updated with current ticks. |
Beta Was this translation helpful? Give feedback.
-
Ok so I think my confusion with iTime was that its based on the clock, but its actually based on the shaders elapsed time. Since skia sharp is doing individual renders each frame this is always the same. as its being only run once. With that in mind im now calling ToShader from the effect each frame with current time. Not sure this is most efficient way to do this but works for now. |
Beta Was this translation helpful? Give feedback.
-
I am not sure how to pass a changing value, such as clock ticks as a uniform to a custom shader. Can this be done?
For example to implement this shader:
I can pass the colors just fine, just not sure how to pass clock time as computed value.
Beta Was this translation helpful? Give feedback.
All reactions