简体   繁体   English

缩放图形资产vs计算不同屏幕分辨率的图形资产大小

[英]Scaling graphic assets vs calculating graphic assets size for different screen resolutions

Is it a best practice to calculate EXACT graphic assets' size for different screen resolution to increase performance? 最佳实践是为不同的屏幕分辨率计算精确图形资产的大小以提高性能吗? Or is it good enough to just calculate approximate final size of those assets and then scale them so they won't lose sharpness/details? 还是仅计算这些资产的最终最终尺寸然后进行缩放以使它们不会损失清晰度/细节就足够了吗?

It's difficult to answer with all the different things you've tagged. 您标记的所有不同事物都很难回答。

On a modern mobile platform, the compositing is probably GPU-side. 在现代的移动平台上,合成可能在GPU端。 The image will cover the same number of pixels regardless of the texture size, which means it'll run the pixel shader the same number of times. 无论纹理大小如何,图像将覆盖相同数量的像素,这意味着它将对像素着色器运行相同的次数。 You may see moderate variation in how fast the pixel shader runs based on whether the texture fits into the GPU's texture cache. 根据纹理是否适合GPU的纹理缓存,您可能会看到像素着色器的运行速度有所不同。 Smaller is better and dimensions that are powers of 2 are usually better. 越小越好,通常是2的幂。

Aside from speed, if you match the exact size it'll be visually crisper because it avoids resampling. 除了速度外,如果您匹配确切的尺寸,它会在视觉上更加清晰,因为它避免了重新采样。

If it's CPU side, making it the exact right size will probably skip rescaling altogether and be much, much faster. 如果是CPU端,则使其尺寸正确正确将可能完全跳过重新缩放,并且速度要快得多。 (By CPU standards at least, either way you're better off on the GPU) (至少通过CPU标准,无论哪种方式,您在GPU上的状况都更好)

Edit: And of course the real answer is to measure the frame rate difference in your particular situation, instead of asking the internet. 编辑:当然,真正的答案是在您的特定情况下测量帧速率差异,而不是询问互联网。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM