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. 获取 当前显示的 UIViewController

    UIViewController * findBestVC(UIViewController *vc) { if (vc.presentedViewController) { return findB ...

  2. 我告诉你 ,一个 window免费系统下载的网站!

    一个 window免费系统下载的网站! https://msdn.itellyou.cn/

  3. JNDI数据源(在Tomcat下配置JNDI多数据源实例)

    一,添加数据库驱动包加入classpath. 这里我用到了oracle和mysql.所以由两个jar包:ojdbc14.jar和mysql-connector-java-5.1.13-bin.jar. ...

  4. 用 map 表达互斥逻辑

    在这个开发周期遇到这样一个需求: 管理员可以给子账号配置权限,有些权限存在互斥不可同时勾选,比如 审核员和代采.审核和采购员不可同时勾选 之前同事实现的方式如下: 这样每添加一个互斥关系就要遍历一次, ...

  5. TCP|UDP|Http|Socket

    TCP_IP.Http.Socket的区别 - 计算机网络知识库 iOS-Socket网络通信-框架与API - 简书 CocoaAsyncSocket + Protobuf 处理粘包和拆包问题 - ...

  6. MySQL学习【第八篇索引优化】

    一.建立索引的原则(规范) 1.选择唯一性索引 只要可以创建唯一性索引的,一律创建唯一索引(因为速度快呀) 判断是否能创建唯一索引,用count(列名),count(distinct(列名))一样就能 ...

  7. PHP+jQuery实现双击修改table表格

    <td signs="name"> <input type="text" disabled="disabled" read ...

  8. 一条常用的 Sql

    select  *   from  table  where  条件1 .... group  by  字段......  Having  条件1.....Limit 0,10; 1. 根据where ...

  9. Altium Designer (DXP) 复制粘贴,放器件 出错报异常的原因

    安装好Altium Designer (DXP) 09板和2013后,运行后原理图复制粘贴元件或者放心的器件后出现下面异常, 原因是: 1.未启动 Print Spooler服务 2.没有安装任何打印 ...

  10. Hive配置项的含义详解

    关于MetaStore:metastore是个独立的关系数据库,用来持久化schema和系统元数据. hive.metastore.local:控制hive是否连接一个远程metastore服务器还是 ...