Reflections 反射

Reflection Source 反射源

By default, objects in a scene are rendered using Unity’s ‘Standard Shader’. The Standard Shader is a 'physically based shader' (PBS). This attempts to accurately represent the behavior of light on materials by mimicking physical properties such as reflectivity and the principles of ‘energy conservation’ which exist in the real world.

默认情况下,场景中的对象使用Unity的“标准着色器”渲染。 标准着色器是一个“基于物理的着色器”(PBS)。 这试图通过模仿物理特性(如反射率和现实世界中存在的“能量守恒”原则)来准确地表示光在材质上的行为。

When using the Standard Shader, every material has a degree of reflectivity based on its ‘specularity’, or ‘metalness’. Without hardware powerful enough to ray trace reflections in realtime we have to rely on pre-rendering reflections. We do this with a cubemap - a 6-sided image of the world derived either from the sky, or from a ‘Reflection Probe’ which renders the environment from a specific point in space, writing the results to a texture. This is then blended with other lighting and surface data by a material’s shader in order to approximate the effects of reflectivity, like we see in the real world.

使用标准着色器时,每种材质都会根据其“镜面反射率”或“金属感”具有一定程度的反射率。 没有足够强大的硬件来实时追踪反射,我们必须依靠预渲染反射。 我们用一个立方体贴图来实现这个功能 - 这是一张来自天空的6面影像,也可以是一个从空间特定点渲染环境的“反射探测器”,将结果写入纹理。 然后通过材质的着色器将其与其他照明和表面数据混合,以便近似反射率的影响,就像我们在现实世界中看到的那样。

By default, highly Specular/Metal materials in your scene will reflect the Skybox, defined by the Reflection Source property of the Environment Lighting Panel. This behaviour can be changed by choosing a different source, or by adding a Reflection Probe to your scene.

默认情况下,场景中的高度镜面/金属材质将反映由环境照明面板的反射源属性定义的Skybox。这种行为可以通过选择不同的来源或通过向场景添加反射探针来改变。

By default, objects in a Unity scene will reflect the Skybox. However, this behaviour can be changed globally in the Lighting window using the ‘Reflection Source’ property. The Skybox, or alternatively, a custom cubemap may be used. This ‘Reflection Source’ can be thought of as a scene-wide cubemap used by all objects in the scene, unless overridden - by adding a Reflection Probe.

默认情况下,Unity场景中的对象将反映Skybox。但是,这种行为可以在照明窗口中使用“反射源”属性进行全局更改。可以使用Skybox或者自定义立方体贴图。这个“反射源”可以被认为是场景中所有对象使用的场景范围的立方体贴图,除非通过添加反射探测器覆盖这个反射源。

Reflection Probes 反射探针

Often it is undesirable for objects to simply reflect the Skybox in a Unity scene. In many instances, objects may be blocked or ‘occluded’ from the sky. They may be indoors or underneath an architectural feature like a bridge or tunnel . To create more accurate reflections we need to sample what objects ‘see’ using a ‘Reflection Probe’. These probes render the world from their position in 3D space and write the results to a cubemap. This can then be used by nearby objects to give the impression that they are reflecting the world around them.

通常情况下,对象只能在Unity场景中反射Skybox是不可取的。在很多情况下,物体可能被遮挡或从天空“遮挡”。它们可能在室内或建筑特征如桥或隧道下。为了创建更精确的反射,我们需要使用“反射探针”来对什么物体进行“观察”。这些探测器从3D空间中的位置渲染世界,并将结果写入立方体贴图。这可以被附近的物体使用,给人的感觉是他们正在反射周围的世界。

A reflection probe can be added via (GameObject>Light>Reflection Probe).

反射探针可以通过(GameObject>Light>Reflection Probe)添加。

The position of a Reflection Probe will determine what the generated cubemap looks like, and therefore what is ‘seen’ in the reflections. Generally, for performance reasons it is better to use as few probes as possible. Remember, reflection probes are not meant to give physically accurate results, but instead give the impression of reflections in the game world. A few well placed probes throughout your scene will be sufficient in most cases.

反射探针的位置将决定生成的立方体贴图的外观,以及反射中“看到”的内容。一般来说,出于性能原因,最好尽可能少地使用探针。请记住,反射探测器并不是为了给出物理上准确的结果,而是给游戏世界带来反思的印象。在大多数情况下,整个场景中的几个放置好的探头就足够了。

Left: Our scene with default reflections. Right: With a Reflection Probe added.

左:我们的场景具有默认反射。右图:添加了反射探针。

 

In the Inspector panel for a Reflection Probe we can set the ‘Type’ property of the probe to choose between ‘Baked’, ‘Custom’ or ‘Realtime’. It should be noted that Realtime Reflection Probes are extremely detrimental to performance as we are effectively rendering the scene an additional 6 times for each probe. There are specific cases where a realtime reflection probe is required and this expense is justified, but as a general rule, Baked Reflection Probes are preferable as they are considerably more performant.

在用于反射探针的Inspector面板中,我们可以设置探针的'Type'属性以在'烘焙','自定义'或'实时'之间进行选择。应该注意的是,实时反射探头对性能极其不利,因为我们有效地为每个探头再现了6次场景。有些特殊情况需要实时反射探头,而且这种费用是合理的,但作为一般规则,烘烤反射探头是更可取的,因为它们性能更高。

Note that GameObjects are only visible to Baked Reflection Probes if marked as ‘Reflection Probe Static’ from the ‘Static’ drop-down at the top of the Inspector panel. Conversely, ‘Realtime’ probes render all visible GameObjects in the world unless a culling mask is applied.

请注意,只有在检查器面板顶部的“Static”下拉列表中标记为“Reflection Probe Static(反射探针静态)”时,GameObjects才会对“Baked Reflection Probes(烘烤反射探针)”可见。相反,除非应用了剔除掩码,否则“实时”探针将呈现世界上所有可见的GameObjects。

<wiz_tmp_tag id="wiz-table-range-border" contenteditable="false" style="display: none;">

 

Unity Lighting - Reflections 反射(六)的更多相关文章

  1. Unity Lighting(一)光照练习

    Unity 2018.1.2f1 原文链接:https://www.youtube.com/watch?v=VnG2gOKV9dw Unity Lighting练习最终效果 眼睛.光源与物体 光学基础 ...

  2. 关于Unity中的光照(六)

    反射探头 1:镜子金属等具有光滑表面的物体都会反射,而游戏中计算实时反射非常消耗CPU的资源, unity5.0新增了一个反射探头的技术,通过采样点,生成反射Cubemap,然后通过特定的着色器从Cu ...

  3. 【Unity Shader】(六) ------ 复杂的光照(上)

    笔者使用的是 Unity 2018.2.0f2 + VS2017,建议读者使用与 Unity 2018 相近的版本,避免一些因为版本不一致而出现的问题.              [Unity Sha ...

  4. Unity Lighting - Light Types 灯光类型(八)

      Light Types 灯光类型 We have now covered some of the project settings which need to be considered befo ...

  5. Unity Lighting - The Precompute Process 预计算过程(二)

      The Precompute Process 预计算过程 In Unity, precomputed lighting is calculated in the background - eith ...

  6. Unity Lighting - Choosing a Lighting Technique 选择照明技术(一)

      Choosing a Lighting Technique 选择照明技术 https://unity3d.com/cn/learn/tutorials/topics/graphics/choosi ...

  7. Unity Lighting - Lighting overview 照明概述

    Lighting overview 照明概述     In order to calculate the shading of a 3D object, Unity needs to know the ...

  8. Unity插件 - MeshEditor(六) 变形动画状态机

    变形动画状态机--MeshAnimator,是针对MeshAnimation的状态管理器,有大量类似Unity animator的功能,但MeshAnimator操作会更加简便,更加直观,居家旅(zh ...

  9. Unity Lighting - Light Probes 光照探针(十)

      Light Probes 光照探针 Only static objects are considered by Unity’s Baked or Precomputed Realtime GI s ...

随机推荐

  1. 多线程简单案例 - join( ) -lock()

    join() 在调用结束前,主线程不会结束 不加的话,主线程会在子线程结束前继续执行:加了join(),主线程会等待子线程结束后在继续执行下去 #python3 #main print number ...

  2. wordpress安装(ubuntu+nginx+php+mariadb)

    一.   环境 ubuntu12.04.4 nginx 1.6.0 mariadb 10.0 更新系统补丁 sudo apt-get update sudo apt-get dist-upgrade ...

  3. 浅谈JS作用域和闭包

    函数表达式和函数声明 变量/函数声明都会提前 console.log(a) let a =1 那么打印出来的a为 undefined,因为会将a提到前面并赋予默认值undefined 函数声明:函数声 ...

  4. jdk 配置

    JDK (绿色版)      此次安装的 JDK 版本为  1.8.0_77 步骤一: 拷贝 JDK(350M左右)到电脑 步骤二: 配置环境变量  JAVA_HOME  , PATH  ,  CLA ...

  5. 20190313-时间和日期-Time

    概述 在Python中,与时间处理相关的模块有:time.datetime以及calendar,Python中通常有这几种方式表示时间:时间戳.格式化的时间字符串.时间元组(struct_time 共 ...

  6. python 内置调试工具 pdb

    除了 pycharm 可以调试python外,python自带的内置工具pdb 也可以调试 python.其命令方式类似于 gdb. pdb 常用的调试命令见下表. 命令 解释 break 或 b 设 ...

  7. STM32串口一直进中断

    调试过程中遇到了使用串口什么都没接却一直进中断,接串口线到电脑上测试又正常的问题. 网上有人说需要将USART的RX模式从输入浮空改成输入上拉,改后测试正常,问题解决. 分析可能是什么都不接时浮空模式 ...

  8. java基础之while循环练习(2)

    实现猜数游戏,如果没有猜对随机数,则程序继续,猜对后停止程序. 方法思路: 1:要产生一个随机数,所以需要创建一个随机数对象 Random random=new Random(): 2: 调用随机数对 ...

  9. 20155215 《Java程序设计》实验二( Java面向对象程序设计)实验报告

    20155215 <Java程序设计>实验二( Java面向对象程序设计)实验报告 实验内容 初步掌握单元测试和TDD 理解并掌握面向对象三要素:封装.继承.多态 初步掌握UML建模 熟悉 ...

  10. 20155301 《Java程序设计》实验五网络编程与安全

    20155301 <Java程序设计>实验五网络编程与安全 实验内容 实验1: 两人一组结对编程:参考http://www.cnblogs.com/rocedu/p/6766748.htm ...