艺术家在手机游戏开发方面的最佳实践

Our partners at Arm have put together a series of in-depth guides to help technical artists and game developers optimize their game art and improve performance when building for varied mobile hardware.

我们在 Arm的 合作伙伴 汇集了一系列深入的指南,以帮助技术美术师和游戏开发人员在构建各种移动硬件时优化游戏美术并提高性能。

Technical artists face the challenge of wanting to build stunning mobile games while keeping assets in line with mobile hardware limitations and performance needs. If you’re coming from other platforms (such as PC or console), it can be hard to find good resources that give you the information and guidance you need to create assets for mobile platforms.

技术美术师面临的挑战是,要打造出色的手机游戏,同时保持资产符合移动硬件限制和性能需求。 如果您来自其他平台(例如PC或控制台),则很难找到可以为您创建移动平台资产所需的信息和指南的优质资源。

That’s why our partners at leading mobile chip design company Arm have created a comprehensive guide to optimizing and improving performance for geometry, texturing, materials, and shaders, geared towards technical artists. We’ve chosen four of their tips to share on this blog, and you can find the full guide free to download here.

这就是为什么我们领先的移动芯片设计公司Arm的合作伙伴针对技术人员创建 了全面的指南, 以优化和改善几何,纹理,材料和着色器的性能。 我们已经选择了他们的四个技巧在此博客上分享,您可以在 此处 免费下载完整指南 。

视觉尺寸 (Visual sizes)

Getting your mobile title to run on the large array of mobile devices can be challenging, and it’s important to keep a tight budget for the memory resources you have to work with. When you’re creating an asset, keep in mind its visual size, or how many pixels it takes up on the screen. The bigger it is, the more texture space you can allow it –  you don’t want to waste a lot of visual size on a game asset that will only take up a few pixels in the background.

要使移动标题在各种移动设备上运行都可能会充满挑战,并且对于要使用的内存资源保持紧张的预算至关重要。 在创建资产时,请记住其视觉尺寸或它在屏幕上占用的像素数。 它越大,您可以允许的纹理空间就越大–您不希望在只占用背景像素的游戏资源上浪费大量视觉尺寸。

In our example below, you can see a game where two armies are going into battle. The soldiers’ textures are kept quite small since each one only takes up a few pixels on the screen. This serves a couple of purposes. First, keeping the texture small reduces memory overhead. Second, well-sized textures enable you to add them to an atlas – you can read more about the benefits of an atlas in the Texturing section of the real-time art best practices

在下面的示例中,您可以看到一个两军参战的游戏。 士兵的材质保持很小,因为每个人仅占用屏幕上的几个像素。 这有两个目的。 首先,保持纹理较小可减少内存开销。 其次,适当大小的纹理使您可以将它们添加到地图集中– 您可以在实时艺术最佳实践的“纹理”部分中阅读有关地图集的好处的更多信息

This concept also carries over to the soldiers’ mesh. You can see the triangles of the soldiers below. Similar to texturing, low triangle counts are helpful to keep the overhead down since the GPU has to process objects’ vertices. This tactic also avoids what is known as a micro triangle problem: when a mesh has a lot of triangles – and therefore a lot of vertices – the GPU has to render them all. This holds even when an object is too small or far away in the scene – the triangles still require a lot of GPU processing power, even though they’re only a few pixels in size.

这个概念也延续到了士兵的网眼中。 您可以在下面看到士兵的三角形。 与纹理化相似,由于GPU必须处理对象的顶点,因此较低的三角形数量有助于降低开销。 这种策略还避免了所谓的微三角形问题:当网格具有很多三角形(因此有很多顶点)时,GPU必须渲染所有三角形。 即使物体太小或在场景中距离太远,这种情况仍然适用–即使三角形只有几个像素,三角形仍然需要大量的GPU处理能力。

压缩类型很重要 (Compression type matters)

When artists are creating a texture, it’s common for them to export it as a PNG, JPG, or TGA file. However, when the game runs, these files are converted to specialized formats that are faster and smaller in memory. 

当艺术家创建纹理时,通常将其导出为PNG,JPG或TGA文件。 但是,在游戏运行时,这些文件将转换为更快,更小的内存专用格式。

When picking a compression type, it’s important to use a format that will perform well to support the artistic vision for the project. Our recommendation is to use ASTC because it offers you the option to control the quality of the compression. Setting it to 5×5 or 6×6 is a great starting point for most assets. You can also try 8×8 or even 10×10 for smaller assets, as these will only take a few pixels on the screen. We’d also recommend experimenting with the different settings to find what works best for your project.

选择压缩类型时,务必使用性能良好的格式以支持项目的艺术视觉,这一点很重要。 我们建议使用ASTC,因为它为您提供了控制压缩质量的选项。 对于大多数资产而言,将其设置为5×5或6×6是一个很好的起点。 对于较小的资产,您也可以尝试使用8×8甚至10×10,因为这些仅占用屏幕上的几个像素。 我们还建议尝试不同的设置,以找到最适合您的项目的设置。

详细程度(LOD)和Mip贴图 (Level of Detail (LOD) & Mip Maps)

As mentioned above, the fewer vertices an object has, the faster the GPU can compute it. At times, this can be at odds with a project’s artistic goals, which can aspire to have an object look as good from far away as it does up-close. This is where a Level of Detail (LOD) system comes in. 

如上所述,对象具有的顶点越少,GPU可以计算得越快。 有时,这可能与项目的艺术目标不一致,艺术目标可以使物体看起来像远处的物体和近处的物体一样好。 这是详细级别(LOD)系统出现的地方。

A LOD system uses a lower-poly version of the model as an object moves further away from the camera. These models are made by the artist, and the distance at which they change out is controllable. This strategy keeps the vertices count down and helps to tackle the micro triangle problem discussed above while giving you performance when the object is far away and detail when the object is in the foreground.

当对象远离摄像机时,LOD系统使用该模型的低多边形版本。 这些模型是由艺术家制作的,更改时的距离是可控制的。 此策略可以使顶点向下计数,并有助于解决上面讨论的微三角形问题,同时在对象较远时为您提供性能,而在前景中时则为您提供细节。

To make LODs even more efficient while supporting the visual quality of your app, the resolution of textures should scale up and down as you change between LODs. In Unity, this tactic is made easier using Mip Maps.

为了在支持应用程序的视觉质量的同时提高LOD的效率,在LOD之间进行切换时,纹理的分辨率应上下缩放。 在Unity中,使用Mip Maps使此策略更容易。

Mip Maps are copies of the texture that are saved at smaller resolutions. When an object is further away from the camera, it will use the lower-resolution version to prevent unneeded “crunchy-ness” in your textures. Given how Mips work, they are best used on objects that will not be a fixed distance from the camera. Combining Mips with LODs can really help speed up a scene.

Mip贴图是以较低的分辨率保存的纹理副本。 当物体离相机更远时,它将使用较低分辨率的物体,以防止纹理中不必要的“松脆”。 鉴于Mips的工作原理,最好将其用于距相机不固定距离的物体上。 将Mips与LOD结合使用确实可以帮助加速场景。

仅在绝对必要时使用透明度 (Only use transparency when it’s absolutely necessary  )

While transparency is expensive to render on all platforms, it is excessively so on mobile because of what is called “overdraw.” Overdraw happens when the GPU has to render a pixel multiple times. Each pixel that a transparent object overlaps has to be rerendered, which greatly affects the game’s performance. However, if you do need to use transparency in your game, you should know about the different options available to you. 

尽管在所有平台上渲染透明度都很昂贵,但由于所谓的“透支”,在移动设备上透明度过高。 当GPU必须多次渲染像素时,会发生透支。 透明对象重叠的每个像素都必须重新渲染,这极大地影响了游戏的性能。 但是,如果您确实需要在游戏中使用透明度,则应该了解可用的不同选项。

Alpha blendAlpha blend is the recommended option for mobile since mobile GPUs have optimization features that help them to render alpha-blended objects. Alpha blend allows you to have a range of transparency options, rather than just turning it on or off like a cutout.  

阿尔法混合 Alpha blend是移动设备的推荐选项,因为移动GPU具有优化功能,可帮助它们渲染Alpha混合对象。 使用Alpha混合,您可以拥有一系列的透明度选项,而不仅仅是像抠图一样将其打开或关闭。

Alpha testAlpha test transparency can make an object look totally opaque or transparent, but it allows nothing in between. This is often referred to as “cut out.” We strongly recommend avoiding cutouts on mobile because they disable several optimization features of the GPU.

阿尔法测试 Alpha测试透明性可以使对象看起来完全不透明或透明,但两者之间什么也不允许。 这通常称为“剪裁”。 我们强烈建议您避免在移动设备上使用抠图,因为它们会禁用GPU的多项优化功能。

结论 (Conclusion)

For us, it was very hard to choose the top takeaways from the real-time 3D art best practices – there is so much useful information and guidance there. If you’re a beginner, the guides provide tips that will be useful in your day-to-day work. If you’re already a pro, share this with your team. Game development is great because it’s a community effort – we all win when game experiences get better! 

对于我们来说,很难从实时3D美术最佳实践中选择最热门的东西-那里有很多有用的信息和指导。 如果您是初学者,这些指南将提供一些技巧,这些技巧在您的日常工作中会很有用。 如果您已经是专业人士,请与您的团队分享。 游戏开发之所以出色,是因为这是社区的努力–当游戏体验变得更好时,我们所有人都会获胜!

Get the 3D art best practices guide

获取3D艺术最佳做法指南

翻译自: https://blogs.unity3d.com/2020/04/07/artists-best-practices-for-mobile-game-development/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值