Libgdx-纹理 [英] Libgdx - textures
问题描述
如果我创建一个.PNG 1024 x 1024的纹理并在中间绘制一个124 x 124的圆圈,则该圆圈周围将是空的,它是否使用与我绘制一个圆圈124 x相同的RAM数量? 124x124空间上的124?
If I create a texture of .PNG 1024 x 1024 and draw a circle in the middle that is 124 x 124, around it would be empty, does it use the same amount of RAM as if I would draw a circle 124 x 124 on a 124x124 space?
我可以在1920 x 1080的Photoshop中制作所有精灵,然后将其放置在其中,然后以0、0坐标导入游戏中的所有精灵,并且一切都会完美地放置!
I could make all sprites in photoshop on a 1920 x 1080, and lay it out there already and then import all in game at a 0, 0 coordinate and all would lay out perfectly!
推荐答案
透明度与RAM的使用无关-它取决于解码图像的大小,这意味着对于图片16x16
,它需要的内存比其大4倍. 8x8
是否透明
Transparency has nothing to do with RAM usage - it depends on how big in decoded image it means that for picture 16x16
it will need 4 times more memory than for 8x8
no matter if it is transparent or not
第二件事是,使用这样的图片会影响渲染性能,因为渲染器将需要迭代"所有像素-这些像素也是透明的
Second thing is that by using pictures like this you will impact rendering performance because renderer will need to "iterate" over all pixels - also these transparent
这篇关于Libgdx-纹理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!