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. 分享一个ASP.NET的弹出层,比较好用!

    网上的一些弹出层的控件多了去了,我很久之前用了一个,效果还不错,但如果应用到ASP.NET的话,会出现“弹出层内的控件runat='server'失效”的情况,具体情况我也不太会描述,但就是那些onc ...

  2. ASP.NET Core 中的 WebSocket 支持(转自MSDN)

    本文介绍 ASP.NET Core 中 WebSocket 的入门方法. WebSocket (RFC 6455) 是一个协议,支持通过 TCP 连接建立持久的双向信道. 它用于从快速实时通信中获益的 ...

  3. Strategy(策略)模式

    1.概述 在软件开发中也常常遇到类似的情况,实现某一个功能有多种算法或者策略,我们可以根据环境或者条件的不同选择不同的算法或者策略来完成该功能.如查找.排序等,一种常用的方法是硬编码(Hard Cod ...

  4. Java中的集合框架-Collections和Arrays

    上一篇<Java中的集合框架-Map>把集合框架中的键值对容器Map中常用的知识记录了一下,本节记录一下集合框架的两个工具类Collections和Arrays 一,Collections ...

  5. Windows Server2012,启动黑屏,只会弹出一个cmd命令窗口的解决办法

    Windows Server2012 服务器.在添加删除一个角色功能的时候,有可能会误删除Net Framework 4.5这个电脑基本功能组件. 就会影响到GUI界面的显示,所以服务器打开就只会黑屏 ...

  6. MySQL----MySQL数据库入门----第三章 添加、更新与删除数据

    3.1 添加数据 ①为所有字段添加数据 方法1:字段包含全部定义的字段 insert into 表名(字段1,字段2...字段n) values(值1,值2,......,值n); 方法2:值必须与字 ...

  7. Java与数据库学习总结

    1.连接数据库 package utils; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Re ...

  8. 偏前端-vue.js学习之路初级(一)概念

    首先--不推荐新手直接使用 vue-cli,尤其是在你还不熟悉基于 Node.js 的构建工具时.    新建一个html,引入一下js: <!-- 开发环境版本,包含了有帮助的命令行警告 -- ...

  9. Vue基础学习(纯属个人学习的笔记,慢慢新增)

       1.在html文件中,声明了template对象,那么在 data对象中的v-html和v-text的绑定数据是不起作用的 2.v-的几个常用绑定 v-html和v-text:引用的conten ...

  10. echo、print、print_r、var_dump

    echo(): 可以一次输出多个值,多个值之间用逗号分隔.echo是语言结构(language construct),而并不是真正的函数,因此不能作为表达式的一部分使用. print(): 函数pri ...