sleitnick @sleitnick.com · Nov 10

Here's how it works. I give the shader the "Start" layer, and the "Count" (number of animation frames), as well as an interval to increment the count. At the bottom, I'm simulating the rotation of the whole windmill too, which would usually be done from game code.

1 likes 1 replies

?

Replies

sleitnick · Nov 10

And here is the relevant shader code that calculates the layer (which is basically the image index within the spritesheet)