本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于Unity2018.3版本
翻译中有些术语不准确,但不影响理解的,不再一一调整,请谅解。
参考链接:https://unity3d.com/cn/learn/tutorials/projects/creating-believable-visuals/lighting-strategy?playlist=17102
Before starting to create final assets and approaching lighting for a Scene, it is important to figure out your lighting strategy. At the start of a project, it is very easy for content creators - eager to start making cool things - to overlook this important step. Altering your lighting strategy late in development is a costly operation. Taking the time to get this right before you enter production will save time while giving better performance and a higher visual fidelity.
在开始创建最终资产和进入场景光照之前,确定您的光照策略是很重要的。在项目开始时,内容创建者很容易忽视这一重要步骤,因为他们急于开始制作很酷的东西。在开发后期改变你的光照策略是一个昂贵的操作。在投入生产之前花点时间弄清楚这一点可以节省时间,同时提供更好的性能和更高的视觉保真度。
Much like anything in real life, there’s almost always trade-off between the benefits and costs of one setup or another. Just as a Formula 1 Car isn’t well suited for everyday groceries shopping compared to its gas saving hybrid car siblings. There are times however, where certain technologies will give you options to mitigate these trade-offs within specific constraints and knowing each features and trade-off will allow you to choose what’s best for your project.
就像现实生活中的任何事情一样,在一个或另一个设置的收益和成本之间几乎总是存在权衡。就像一级方程式赛车不太适合与日常生活用品购物用的混合动力车比省油。然而,有些时候,某些技术会在特定的限制条件下为您提供减轻这些权衡的选项,了解每个特性和权衡将会使您选择最适合项目的方法。
Going back to our Lighting, a typical Scene, at daytime, with outdoor areas can be broken down to 3 lighting components:
回到我们的光照,一个典型的场景,在白天,户外区域可以分为3个光照组件:
This seems like three simple components. How you choose to mix and match real time lights, mixed lights, baked lights, static objects and dynamic objects ends up creating a diverse range of potential lighting options.
这看起来像三个简单的组件。您可以选择如何混合和匹配实时灯光、混合灯光、烘焙灯光、静态对象和动态对象,最终将创建各种潜在的光照选项。
In Unity we cater to lots of different lighting strategies and project scenarios.
在Unity中,我们满足了许多不同的光照策略和项目情境。
Find the documentation to understand lighting modes and setup here.
在这里可以找到理解光照模式和设置的文档。
For newcomers, this can be overwhelming to figure out which setup and what the trade-off are for each setup. Let’s distill this mass of information down to the most commonly used setup.
对于新手来说,弄清楚哪种设置以及每种设置的权衡是非常困难的。让我们将这些信息提炼为最常用的设置。
These 5 are the most commonly used lighting setup.
这5种是最常用的光照设置。
Visual notable differences between these options:
这些选项之间的视觉有显著的差异:
Basic realtime, the specular highlights from the light are visible but no indirect lighting.
基于实时,光照的高光是可见的,但没有间接光照。
Baked, soft baked shadows are visible, high resolution static indirect lighting, but there is no specular response from lights and dynamically lit object don’t cast shadows.
烘焙,烘焙软阴影是可见的,高分辨率静态间接光照,但灯光没有高光反射和动态照明对象不投阴影。
Mixed Lighting, similar to Baked, but with specular response and dynamically lit object cast shadows.
混合照明,类似于烘焙,但具有高光反射和动态照明对象投射阴影。
Realtime Light and GI, proper indirect lighting response, specular response are visible, lights are all moveable and updateable, but there’s no angular soft shadow.
实时光和GI,适当的间接光照反射,高光反射是可见的,所有的光都是可移动和可更新的,但没有角软阴影。
Guns Blazing all options enabled, depending on the settings of each light you can achieve the combination of all the above options.
所有选项全部启用,根据每个灯的设置,您可以实现上述所有选项的组合。
The slideshow above showcase baked Ambient Occlusion when enabled. NOTE: Realtime GI can’t bake static ambient occlusion and hence not included.
当启用时,上面的幻灯片显示烘焙环境光遮蔽。注:实时GI不能烘焙静态环境光遮蔽,因此不包括在内。
Here are the general characteristics for each configuration:
以下是每种配置的一般特征:
Basic Realtime lighting + Ambient (with no Realtime GI or Baked GI).
基本实时光照+环境(没有实时GI或烘焙GI)。
Typical platform target: Console and PC. Generally used in stylistic visual project and prototype phase.
典型的平台目标:控制台和PC。一般用于与视觉有关的工程和原型阶段。
Advantage:
Disadvantage:
All baked lighting + Light Probe.
全部烘焙光照+光照探头
Typical platform target: Mobile platform, VR, console and low end PC. Generally used in games where runtime performance in an issue but there’s room in memory, such as top down isometric mobile games and high frame rates VR game.
典型平台目标:移动平台、VR、主机、低端PC。一般用于运行时性能有问题但内存有空间的游戏,如自顶向下等距的移动游戏和高帧率VR游戏。
Advantage:
Disadvantage:
Mixed lighting with Shadowmask + Light Probe.
混合光照与阴影遮罩+光照探头
Typical platform target: VR, console and PC. Generally used in majority of console games and pc games where time of day lighting such as sun movement is not important.
典型平台目标:VR,主机,PC。一般用于大多数主机游戏和PC游戏中,光照的时间系统如太阳运动并不重要。
Advantage:
Disadvantage:
The above list is an oversimplification description of shadowmask lighting. Complete information can be found here.
上面的列表是对阴影遮罩的过度简化描述。完整的信息可以在这里找到。
Realtime lighting with Realtime GI + Light Probe.
实时光照与实时GI +光照探头
Typical platform target: Console and PC. Generally used in open area game where time of day lighting updates is required and dynamic lighting effect are required as part of the game design.
典型的平台目标:控制台和PC。一般用于户外游戏中,光照的时间系统需要更新,游戏设计需要动态灯光效果。
Advantage:
Disadvantage:
In depth information in optimizing Realtime GI can be found here.
Guns blazing, all option enabled.
开火,所有选项已启用。
Typical platform target: Console and PC. Generally used for games with high fidelity requirements with tightly controlled memory usage and performance limit. Best enabled when the content creators completely understood each individual system and has proper knowledge on handling each of the lighting combination implication.
典型的平台目标:主机和PC。一般用于对游戏保真度要求高、内存使用和性能限制控制严格的游戏。当内容创造者完全理解每一个单独的系统,并且对处理每一个灯光组合的含义有适当的知识时,最好是启用。
Advantage:
Disadvantage:
For faster iteration and learning lighting a Scene, responsive visual feedback is necessary. For this reason, the Spotlight Tunnel Sample Scene is using Realtime Lighting w/ Realtime GI. This will give us a nice range of specular response, good bounce lighting, and let us change our lights on the fly.
为了更快的迭代和学习光照场景,即时视觉反馈是必要的。由于这个原因,聚光灯隧道示例场景使用的是实时照明w/ Realtime GI。这将给我们一个很好的高光反射的范围,不错的碰撞光照,让我们快速地改变我们的光照。