Unity Graphics (Unity 图形渲染 ) 官方教程文档笔记系列之五

Unity Graphics (Unity 图形渲染 )
- Everything for Lighting and Rendering in Unity
- 主要涉及到光照与渲染方面的知识

本文档主要是对Unity官方教程的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
文章中涉及到的操作都是基于 Unity2017.3版本
参考链接:https://unity3d.com/cn/learn/tutorials/s/graphics


下面是将要介绍的章节,黑体是本次内容:

  • Introduction to Lighting and Rendering(5)
    介绍光照和渲染(5)
  • Precomputed Realtime GI (Realtime Global Illumination)
    预处理实时全局光照
  • Rendering and Shading
    渲染与着色
  • Cameras and Effects
    相机与效果
  • Geometry in Unity
    几何体

10.Emissive Materials

自发光材质

Whilst Area Lights are not supported by Precomputed Realtime GI, similar soft lighting effects are still possible using ‘Emissive Materials.’ Like Area Lights, emissive materials emit light across their surface area. They contribute to bounced light in your scene and associated properties such as color and intensity can be changed during gameplay.
‘Emission’ is a property of the Standard Shader which allows static objects in our scene to emit light. By default the value of ‘Emission’ is set to zero. This means no light will be emitted by objects assigned materials using the Standard Shader. The HDR color picker can be used to select colors with intensities beyond the 0-1 range in order to create bright light effects similar to those of Area Lights.
There is no range value for emissive materials but light emitted will again falloff at a quadratic rate. Emission will only be received by objects marked as ‘Static’ or “Lightmap Static’ from the Inspector. Similarly, emissive materials applied to non-static, or dynamic geometry such as characters will not contribute to scene lighting.

然而,区域光并不支持预计算实时GI,类似柔光效果可以使用“自发光材质”。像区域光,自发光材质从其表面区域发射光照。他们会在场景中碰撞光照,相关属性也可以在运行时修改,比如颜色和强度。
“自发光”在标准着色器是一个属性,允许静态对象发射光,默认值为0。这表示没有自发光通过对象发射出来。可以用HDR颜色拾取器选择颜色,强度可以调整超过0-1范围,为此可以创建出和区域光类似的效果。
自发光材质没有范围,但会平方反比衰减。自发光只被静态或光照图静态的对象接受。类似,自发光应用到非静态,或动态几何体,比如角色,将不会影响到场景光照。

However, materials with an emission above zero will still appear to glow brightly on-screen even if they are not contributing to scene lighting. This effect can also be produced by selecting ‘None’ from the Standard Shader’s ‘Global Illumination’ Inspector property. Self-illuminating materials like these are a useful way to create effects such as neons or other visible light sources.

然而,即使对场景光照没有产生影响,自发光材质大于0将在屏幕上仍会高亮。自发光可以在属性面板上关闭。自发光在创造像霓虹灯或其他可见光源是比较有用的。
这里写图片描述
Simple neon sign created using the ‘Emission’ property of Unity’s Standard Shader. Notice how the emission from the sign is still shadowed by static geometry - in this case, the sphere.
用Unity标准着色器的自发光属性创造简单的霓虹灯信信号。注意自发光仍可以使静态几何体产生阴影,这里是个球面。

Emissive materials only directly affect static geometry in your scene. If you need dynamic, or non-static geometry - such as characters, to pick up light from emissive materials, Light Probes must be used. Changing emission values at gameplay will update Light Probes interactively and the results will be visible on any objects presently receiving light from those probes.

自发光只直接影响到静态几何体。如果你需要动态,或非静态几何体,像角色,从自发光材质获取光照,只能选择光照探头了。在运行时改变自发光值将会更新光照探头的交互,这些探头的光照将会在所有对象上呈现出来。

11.Light Probes

光照探头

Only static objects are considered by Unity’s Baked or Precomputed Realtime GI systems. In order for dynamic objects such as interactive scene elements or characters to pick up some of the rich bounced light that our static geometry receives, we need to record this lighting information into a format which can be quickly read and used in our lighting equations during gameplay.
We do this by placing sample points in the world and then capturing light from all directions. The color information these points record is then encoded into a set of values (or ‘coefficients’) which can be quickly evaluated during gameplay. In Unity, we call these sample points, ‘Light Probes’.

Unity的烘焙或预计算实时GI系统只考虑静态对象。为了像场景交互元素或角色这些动态对象去获取一些丰富的碰撞光照(只是静态几何体接收的),我们需要记录光照信息到一个可快速读取和在运行时可用光照公式的格式。
我们通过在世界中放置一些采样点,然后从各个方向捕捉光照。这些点记录的颜色信息被编码到一序列值(系数),这些值可以在运行时被快速的处理。在Unity中,我们称这些采样点为“光照探头”。
这里写图片描述
Scene using Light Probes. Notice how they have been placed in greater density around areas of lighting change - such as shadows or color transition.
场景上使用光照探头。注意他们如何更大密度的放置随着光照区域的变化,比如阴影或颜色变换。

Light Probes allow moving objects to respond to the same complex bounced lighting which is affecting our lightmaps regardless of whether Baked GI or Precomputed Realtime GI is used. An object’s mesh renderer will look for the Light Probes around its position and blend between their values. This is done by looking for tetrahedrons made up by the position of Light Probes, and then deciding which tetrahedron the object’s pivot falls into. This allows us to place moving characters in scenes and have them appear properly integrated. Without Light Probes, dynamic objects would not receive any global illumination and would appear darker than surrounding, lightmapped geometry.
By default there are no Light Probes in a scene so these will need to be placed using a Light Probe Group (GameObjects>Light>Light Probe Group).
If the ‘Auto’ box is checked at the bottom of your scene precompute settings (Lighting>Scene>Auto), Light Probes will update whenever changes are made to the scene lighting or static geometry. Otherwise they will be updated when the Build button is clicked.

光照探头允许移动对象去响应同样复杂的碰撞光源,碰撞光源会影响到无论是用烘焙GI还是预计算实时GI的光照图。一个对象的网格渲染将寻找光照探头的位置,并融合他们的值。通过寻找被光照探头位置组成的四面体,然后确定对象的中心点在哪个四面体内。这允许我们放置移动的角色,并使它们看起来合理协调。没有光照探头,动态对象将不能接受任何GI,会比周围光照映射的几何体更黑。
默认场景中没有光照探头,所以需要用一个光照探头组来放置(【GameObjects>Light>Light Probe Group】)。
如果在场景预计算设置的底部“Auto”被勾选了(【Lighting>Scene>Auto】),光照探头将会随着光照或静态几何体改变而更新。否则,当点击了“生成”按钮再更新。

Further Reading

延伸阅读

In this document we have given an overview of the considerations which need to be made prior to setting up a scene for lighting. We have also briefly looked at the tools available for creating various lighting effects. However, there is still a lot which we haven’t yet covered.
For a more in-depth look at optimizing your Scenes for Unity’s Precomputed Realtime GI please see our tutorial here.

此文档中,我们对设置场景光照首先需要注意事项的总述。也简单地介绍了对创建多种有效光照效果工具。然而,仍有很多内容没有覆盖到。
更多对场景预计算实时GI的深度优化,可见这个文档

猜你喜欢

转载自blog.csdn.net/cangod/article/details/79589675