热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

LightingStrategy光照策略CreatingBelievableVisuals系列3

LightingStrategy光照策略本文档主要是对Unity官方手册的个人理解与总结(其实以翻译记录为主:)仅作为个人学习使用&#

Lighting Strategy 光照策略

本文档主要是对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个光照组件:

  1. Hemisphere (Sky contribution). 半球(天空盒影响)
  2. Direct lights (Sun + Local lights). 直接光(太阳光+局域光)
  3. Indirect lights (Bounced lighting). 间接光(碰撞光照)

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:
这些选项之间的视觉有显著的差异:

  1. Basic realtime, the specular highlights from the light are visible but no indirect lighting.
    基于实时,光照的高光是可见的,但没有间接光照。

  2. 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.
    烘焙,烘焙软阴影是可见的,高分辨率静态间接光照,但灯光没有高光反射和动态照明对象不投阴影。

  3. Mixed Lighting, similar to Baked, but with specular response and dynamically lit object cast shadows.
    混合照明,类似于烘焙,但具有高光反射和动态照明对象投射阴影。

  4. 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,适当的间接光照反射,高光反射是可见的,所有的光都是可移动和可更新的,但没有角软阴影。

  5. 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:

  • All direct lights and shadows are real-time, therefore movable.
    所有的直接光和阴影都是实时的,因此可以移动。
  • Fast iteration because of no precompute or baking and mesh preparation.
    快速迭代,因为没有预先计算或烘焙和网格准备。
  • Dynamic objects and Static objects are lit using the same method, no Light Probes required.
    动态对象和静态对象使用相同的方法光照,不需要光照探头。

Disadvantage:

  • No Hemisphere occlusion, just straight skybox/ambient value and color in area not lit by direct lighting.
    没有半球遮挡,在没有直接光照的区域只有天空盒/环境光值和颜色。
  • Without “Global Illumination” / indirect lighting component, scene might not give the best visual outcome.
    没有“全局光照”/间接光照组件,场景可能不会提供最佳的视觉效果。

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:

  • All lights are baked for static objects, produce ambient occlusion and indirect lighting.
    所有的光都是为静态对象烘焙的,产生环境遮挡和间接光照。
  • Area light bake support and soft shadow angle can be baked onto statically lit objects.
    区域光烘焙支持和软阴影角度可以烘焙到静态发光的物体上。
  • Fastest in runtime performance among the options listed here.
    在这里列出的选项中运行时性能最快。

Disadvantage:

  • Can slow down lighting iteration since lights are baked, therefore requiring light rebuild on Scene changes if progressive Lightmapper aren’t used.
    由于光照是烘焙过的,因此会减慢光照迭代,因此如果不使用渐进Lightmapper,则需要在场景更改时重新构建光照。
  • Dynamically lit objects are lit using Light Probes only.
    动态光照对象仅使用光照探针进行光照。
  • No Specular highlights from light source, relying only on cubemap/reflection.
    没有来自光源的高光,只依赖于cubemap/反射。
  • No shadowing from dynamic objects.
    没有来自动态对象的阴影。
  • Can cost a lot of runtime memory depending on how much lightmap textures used in the scene.
    根据场景中使用了多少光照图纹理,这可能会消耗大量运行时内存。
  • Might require authoring texture coordinates channel 2 (UV2 for lightmap).
    可能需要创建纹理坐标通道2 (UV2用于光照图)。

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:

  • Similar to all baked lighting, but in Mixed lighting, Dynamic object gets real-time specular and cast realtime shadows, while the static object gets baked shadowmask resulting in better visual quality.
    与所有烘焙光照相似,但在混合照明中,动态对象得到实时高光并投射实时阴影,而静态对象得到烘焙阴影遮罩,从而获得更好的视觉质量。

Disadvantage:

  • Object can only have 4 shadowmask limit.
    对象只能有4个阴影遮罩限制。
  • Cost additional performance in runtime for rendering the real-time lights.
    在运行时渲染实时灯光会花费额外的性能。
  • Care needs to be taken in using mixed lights as they can drastically affect performance in certain setups.
    在使用混合光源时需要格外小心,因为它们会对某些设置的性能产生很大的影响。

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:

  • This allow fast lighting iteration with realtime indirect lighting.
    这允许快速光照迭代与实时间接光照。
  • Dynamic and static objects get real time specular and shadows.
    动态和静态对象得到实时的高光和阴影。
  • Can use less memory than baked lighting for giving indirect lighting effect.
    可以比烘焙光照使用较少的内存提供间接光照效果。
  • Fixed cost CPU time performance for updating GI.
    固定的CPU时间性能成本来更新GI。

Disadvantage:

  • Occlusion isn’t as detailed as baked lighting and usually must be augmented by Screen Space Ambient Occlusion (SSAO) and per object texture baked AO.
    遮挡没有烘焙光照那么详细,通常必须通过屏幕空间环境遮挡(SSAO)和每个对象纹理烘焙AO来增强遮挡。
  • No area/ light angle soft shadows for static objects.
    静态物体没有区域光/光照角度的软阴影。
  • Care needs to be taken in using realtime lights as they can drastically affect performance in certain setups.
    在使用实时灯光时需要格外小心,因为它们会在某些设置中严重影响性能。
  • Precompute times (Generate lighting) time can took significant amount of time if there’s too much object contributing to the static lighting especially without optimized UV setup (Requires authoring texture coordinates channel 3 (UV3) for Enlighten Realtime GI further optimization and/or projection fixes.)
    预计算时间(生成光照)的时间可能花大量的时间,如果有太多的对象贡献了静态光照,特别是没有优化的UV设置(需要创作纹理坐标通道3 (UV3),以Enlighten 实时GI进一步优化和/或投影修复)。

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:

  • This is the complete set of lighting features, it gives your content creator all the functionality.
    这是一套完整的光照功能,它给你的内容创造者所有的功能。

Disadvantage:

  • Can potentially burn performance at run time, memory usage.
    可能会在运行时消耗性能和内存使用量。
  • Increase the workflow burden (UV authoring and baking time).
    增加工作流程负担(UV创作和烘焙时间)。

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。这将给我们一个很好的高光反射的范围,不错的碰撞光照,让我们快速地改变我们的光照。


推荐阅读
  • 本文详细介绍了Java中vector的使用方法和相关知识,包括vector类的功能、构造方法和使用注意事项。通过使用vector类,可以方便地实现动态数组的功能,并且可以随意插入不同类型的对象,进行查找、插入和删除操作。这篇文章对于需要频繁进行查找、插入和删除操作的情况下,使用vector类是一个很好的选择。 ... [详细]
  • Java学习笔记之面向对象编程(OOP)
    本文介绍了Java学习笔记中的面向对象编程(OOP)内容,包括OOP的三大特性(封装、继承、多态)和五大原则(单一职责原则、开放封闭原则、里式替换原则、依赖倒置原则)。通过学习OOP,可以提高代码复用性、拓展性和安全性。 ... [详细]
  • JDK源码学习之HashTable(附带面试题)的学习笔记
    本文介绍了JDK源码学习之HashTable(附带面试题)的学习笔记,包括HashTable的定义、数据类型、与HashMap的关系和区别。文章提供了干货,并附带了其他相关主题的学习笔记。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • Whatsthedifferencebetweento_aandto_ary?to_a和to_ary有什么区别? ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • Iamtryingtomakeaclassthatwillreadatextfileofnamesintoanarray,thenreturnthatarra ... [详细]
  • 本文介绍了九度OnlineJudge中的1002题目“Grading”的解决方法。该题目要求设计一个公平的评分过程,将每个考题分配给3个独立的专家,如果他们的评分不一致,则需要请一位裁判做出最终决定。文章详细描述了评分规则,并给出了解决该问题的程序。 ... [详细]
  • Python正则表达式学习记录及常用方法
    本文记录了学习Python正则表达式的过程,介绍了re模块的常用方法re.search,并解释了rawstring的作用。正则表达式是一种方便检查字符串匹配模式的工具,通过本文的学习可以掌握Python中使用正则表达式的基本方法。 ... [详细]
  • IjustinheritedsomewebpageswhichusesMooTools.IneverusedMooTools.NowIneedtoaddsomef ... [详细]
  • 本文介绍了Swing组件的用法,重点讲解了图标接口的定义和创建方法。图标接口用来将图标与各种组件相关联,可以是简单的绘画或使用磁盘上的GIF格式图像。文章详细介绍了图标接口的属性和绘制方法,并给出了一个菱形图标的实现示例。该示例可以配置图标的尺寸、颜色和填充状态。 ... [详细]
  • 欢乐的票圈重构之旅——RecyclerView的头尾布局增加
    项目重构的Git地址:https:github.comrazerdpFriendCircletreemain-dev项目同步更新的文集:http:www.jianshu.comno ... [详细]
  • Week04面向对象设计与继承学习总结及作业要求
    本文总结了Week04面向对象设计与继承的重要知识点,包括对象、类、封装性、静态属性、静态方法、重载、继承和多态等。同时,还介绍了私有构造函数在类外部无法被调用、static不能访问非静态属性以及该类实例可以共享类里的static属性等内容。此外,还提到了作业要求,包括讲述一个在网上商城购物或在班级博客进行学习的故事,并使用Markdown的加粗标记和语句块标记标注关键名词和动词。最后,还提到了参考资料中关于UML类图如何绘制的范例。 ... [详细]
  • 本文整理了Java面试中常见的问题及相关概念的解析,包括HashMap中为什么重写equals还要重写hashcode、map的分类和常见情况、final关键字的用法、Synchronized和lock的区别、volatile的介绍、Syncronized锁的作用、构造函数和构造函数重载的概念、方法覆盖和方法重载的区别、反射获取和设置对象私有字段的值的方法、通过反射创建对象的方式以及内部类的详解。 ... [详细]
  • 本文详细介绍了使用C#实现Word模版打印的方案。包括添加COM引用、新建Word操作类、开启Word进程、加载模版文件等步骤。通过该方案可以实现C#对Word文档的打印功能。 ... [详细]
author-avatar
伊利纯羊毛
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有