Switch language한국어
Back to the list

I guess we now have Sprite Animations

TL;DR AI

Key summary

2 min read
  1. The author added animated sprites to their wgpu-based engine by loading a spritesheet and slicing it into sprites.

  2. Each sprite stores UV coordinates that map to its region on the spritesheet and are used by the renderer.

  3. A SpriteAnimator controls which sprite to show and when, while the SpriteRenderer draws a 2D quad with the sprite's UVs.

  4. The author also implemented text rendering, demonstrated by an FPS counter in the demo.

Read the original