什么是相对于图像序列的精灵表的利弊? [英] What are the pros and cons of a sprite sheet compared to an image sequence?
问题描述
我来自一个2D动画的背景,所以当我过我们的动画序列我preFER使用图像序列。对我来说,这使得有很大的意义,因为你可以轻松地从合成/编辑软件导出图像序列轻易地定义方面。
I come from a 2D animation background and so when ever I us an animated sequence I prefer to use a sequence of images. To me this makes a lot of sense because you can easily export the image sequence from your compositing/editing software and easily define the aspect.
我是新游戏开发和好奇的使用精灵表的。有什么优点和缺点。是文件大小的问题吗? - 对我来说,似乎说了一堆小图片将是相同的一台庞大的之一。此外,定义精灵的各个领域似乎时间很麻烦。
I am new to game development and am curious about the use of a sprite sheet. What are the advantages and disadvantages. Is file size an issue? - to me it would seem that a bunch of small images would be the same as one massive one. Also, defining each individual area of the sprites seems time cumbersome.
基本上,我不明白你为什么会使用一个精灵表 - 请赐教
Basically, I dont get why you would use a sprite sheet - please enlighten me.
感谢
推荐答案
性能是精灵表更好,因为你必须包含在一个单一的纹理所有数据。比方说你有1000个精灵从精灵表玩同样的动画。绘制过程会去像。
Performance is better for sprite sheets because you have all your data contained in a single texture. Lets say you have 1000 sprites playing the same animation from a sprite sheet. The process for drawing would go something like.
Set the sprite sheet texture.
Adjust UV's 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 could result in a worst case of:
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
尔加!绘制之前每一个角色,你就必须设置渲染状态下使用不同的纹理,这是的慢得多的不是调整一对夫妇紫外线的的。
Gah! Before drawing every sprite you would have to set the render state to use a different texture and this is much slower than adjusting a couple of UV's.
这篇关于什么是相对于图像序列的精灵表的利弊?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!