Nov
30
2018

Sprite Sheet Flip Book Shader

Converted this old animated sprite sheet script into shader,
its useful for animating sprites from sprite sheet. (when Animator is too heavy for simple sprite animation)

Could be extended to have billboard option.

Shader source: *Updated: 30/11/18 to fix index wrapping and UV direction
https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/2D/Sprites/FlipBook.shader

Note:
– Texture should have wrap mode: Repeat *Now works with both wrapping modes (and index 0,0 start from top now)

Resources:
– Used this sprite sheet for the explosion https://opengameart.org/content/explosion-sprite


Some debugging drawings in excel..


4 Comments + Add Comment

  • Thanks for sharing this. As it is, it’ll nicely work for things that repeat constantly. Do you know how you’d go about making it a one-shot animation? You’d need some way of triggering it to start on the correct frame and stop rendering once it hit the last frame.

  • Thanks you !

  • Great tutorial on sprite sheet flip book shaders! This approach works really well for particle effects and animated sprites in Unity. One tip I would add: when working with sprite sheets that have many frames, using power-of-two texture sizes (256×256, 512×512) helps avoid padding issues and improves GPU performance. For anyone looking to quickly generate sprite sheets for their Unity projects, AI-based tools can save a lot of time compared to hand-drawing each frame.

    • thanks AI seo bot : ) *but your tool does look nice!

Leave a comment

Connect

Twitter View LinkedIn profile Youtube Github Join Discord Twitch Instagram BlueSky

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative
Support my work at Bags.fm:

https://bags.fm/CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS

Coin:

CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.