What are the pros and cons of sprite versus image sequence?

I come from a 2D animation background, so when I ever use an animated sequence, I prefer to use an image sequence. This makes a lot of sense to me because you can easily export a sequence of images from your layout / editing software and easily determine the aspect.

I am new to game development and I am interested in learning about using a sprite sheet. What are the advantages and disadvantages. Is file size a problem? - It seems to me that a bunch of small images will be the same as one massive. In addition, defining each individual sprite area seems cumbersome.

Basically, I don’t understand why you used the sprite sheet - please enlighten me.

thank

+3
source share
3 answers

Performance is better for sprites because you have all of your data contained in a single texture. Suppose you have 1000 sprites playing the same animation from a sprite sheet. The drawing process will look something like this.

Set the sprite sheet texture.
Adjust UV to show single frame of animation.
Draw sprite 0
Adjust UV's
Draw sprite 1
.
.
.
Adjust UV's
Draw sprite 998
Adjust UV's
Draw sprite 999

Using a texture sequence can lead to a worse case:

Set the animation texture.
Draw sprite 0
Set the new animation texture.
Draw sprite 1
.
.
.
Set the new animation texture.
Draw sprite 998
Set the new animation texture.
Draw sprite 999

G! Before you draw each sprite, you will need to set the rendering state to use a different texture, and this is much slower than setting up a UV pair.

+6
source

(?) . , , 128x128, 512x512 .. / , , . :

  • . 16x32 32x32. ( ).
  • . ? ! , .

, , . , , ?

, , , , - . , ; . , , .

+4
  • , , ( 1 .)
  • , ,
  • , ( )
  • (, - )

There is not much benefit to using sprite sheets, but a few small ones. But the practice dates back to the time when most people used the appropriate 2D-graphics software to create game graphics, so the artist’s workflow was not always the most important at that time.

+2
source

Source: https://habr.com/ru/post/1759440/


All Articles