Unity 编辑器学习(二)之 全局光照(GI)

光影流年,花影阡陌。光与影交织的岁月教育我们,不会使用光照的程序员不是个好美术。

一、概述

点击 Window > Lighting > Settings 会弹出Lighting窗口,这个就是设置全局光照的窗口。

这个Lighting窗口划分了三个区域:

1、Scene:设置适用于整个场景而不是单个GameObjects。这些设置控制灯光效果和优化选择。

2、Global maps:显示所有lightmap资产文件生成的GI照明过程。

3、Object maps:预览当前选中的GameObject的GI lightmap纹理(包括阴影遮罩)。

下方有一个Auto Generate,勾上它,unity就会自动更新Lightmap 数据,但更新的过程非常耗时,

因此不建议勾选 Auto Generate。可以手动点击Generate Lighting来烘焙。(注意,unity只会烘焙

勾选了Lightmap Static 的GameObject,so 烘焙之前,首先在Inspector 面板最上方的Static 选中Lightmap Static)

二、Scene tab

Scene 这一模块,包括以下六个部分:

  • Environment
  • Realtime Lighting
  • Mixed Lighting
  • Lightmapping Settings
  • Other Settings
  • Debug Settings

1、Environment

环境光部分包含设置天空盒,漫反射和镜面反射。

Property: Function:
Skybox Material 天空盒材质
Sun Source 设置一个定向光(directional Light)作为场景里的太阳,如果设置为None,unity则将最亮的定向光作为太阳(太阳:不管你设置的多大远多,光都会照到场景里)
Environment Lighting 环境光设置
Source 漫反射环境光(背景光),默认以天空盒作为环境光。
    Color 以某种颜色作为环境光。
    Gradient //梯度 sky, horizon and ground分别选择一种颜色,混合出一种环境光。
    Skybox 天空盒作为环境光,
Intensity Multiplier//光照强度 环境光的亮度,范围是0-8,默认为1。
Ambient Mode //微光模式 场景中GI的模式。
    Realtime 实时更新。
    Baked 烘焙(预先计算场景中的灯光)。
Environment Reflections 全局设置反射参数。
Source 反射源。
    Skybox 天空盒作为反射源。
    Custom 用一个cube map作为反射源。
Compression//压缩 反射贴图是否被压缩。
    Auto 如果适合压缩,那就压缩。
    Uncompressed 不压缩。
    Compressed 压缩
Intensity Multiplier 反射光的强度。
Bounces//反弹 一束光的被反射的次数。

2、Realtime Lighting

Property: Function:
Realtime Global Illumination 是否开启实时全景光照。

3、Mixed Lighting

Property: Function:
Baked Global Illumination 是否采用烘焙的全局光照。
Lighting Mode 决定混合灯光和GameObject的阴影,修改了Light Mode需要重新烘焙。
Realtime Shadow Color 实时阴影的颜色。 

4、Lightmapping Settings

Property: Function:
Lightmapper Use this to specify which internal lighting calculation software to use to calculate lightmaps in the Scene. The options are Enlighten and Progressive (experimental). The default value is Enlighten. 
See documentation on the Progressive Lightmapper for more information about the experimental Progressive Lightmapper feature.
Indirect Resolution Use this value to specify the number of texels per unit to use for indirect lighting calculations. Increasing this value improves the visual quality of indirect light, but also increases the time it takes to bake lightmaps. The default value is 2.
Lightmap Resolution Use this value to specify the number of texels per unit to use for lightmaps. Increasing this value improves lightmap quality, but also increases bake times. The default value is 40.
Lightmap Padding Use this value to specify the separation (in texel units) between separate shapes in the baked lightmap. The default value is 2.
Lightmap Size The size (in pixels) of the full lightmap texture, which incorporates separate regions for the individual object textures. The default value is 1024.
Compress Lightmaps A compressed lightmap requires less storage space, but the compression process can introduce unwanted visual effects into the texture. Tick this checkbox to compress lightmaps, or untick it to keep them uncompressed. The checkbox is ticked by default.
Ambient Occlusion When ticked, this opens a group of settings which allow you to control the relative brightness of surfaces in ambient occlusion. Higher values indicate a greater contrast between the occluded and fully lit areas. This is only applied to the indirect lighting calculated by the GI system. This setting is enabled by default.
    Max Distance Set a value to control how far rays are cast in order to determine whether an object is occluded or not. A larger value produces longer rays and contributes more shadows to the lightmap, while a smaller value produces shorter rays that contribute shadows only when objects are very close to one another. A value of 0 casts an infinitely long ray that has no maximum distance. The default value is 1.
    Indirect Contribution Use the slider to scale the brightness of indirect light as seen in the final lightmap (that is, ambient light, or light bounced and emitted from objects) from a value between 0 and 10. The default value is 1. Values less than 1 reduce the intensity, while values greater than 1 increase it.
    Direct Contribution Use the slider to scale the brightness of direct light from a value between 0 and 10. The default value is 0. The higher this value is, the greater the contrast applied to the direct lighting.
Final Gather When Final Gather is enabled, the final light bounce in the GI calculation is calculated at the same resolution as the baked lightmap. This improves the visual quality of the lightmap, but at the cost of additional baking time in the editor.
    Ray Count Use this value to define the number of rays emitted for each final gather point. The default value is 256.
    Denoising Tick this checkbox to apply a denoising filter to the final gather output. This box is ticked by default.
Directional Mode You can set the lightmap up to store information about the dominant incoming light at each point on the objects’ surfaces. 
See documentation on Directional Lightmapping for further details. The default mode is Directional.
    Directional In Directional mode, a second lightmap is generated to store the dominant direction of incoming light. This allows diffuse normal mapped materials to work with the GI. Directional mode requires about twice as much storage space for the additional lightmap data.
    Non-directional Non-directional mode switches both these options off. 
Indirect Intensity Use this slider to control the brightness of indirect light stored in realtime and baked lightmaps, from a value between 0 and 5. A value above 1 increases the intensity of indirect light while a value of less that 1 reduces indirect light intensity. The default value is 1.
Albedo Boost Use this slider to control the amount of light bounced between surfaces by intensifying the albedo of materials in the Scene, from a value between 1 and 10. Increasing this draws the albedo value towards white for indirect light computation. The default value of 1 is physically accurate.
Lightmap Parameters Unity uses a set of general parameters for the lightmapping in addition to properties of the Lighting window. A few defaults are available from the menu for this property but you can also create your own lightmap parameter file using the Create New option. See the Lightmap Parameters page for further details. The default value is Default-Medium.

5、Other Settings

Property: Function:
Other Settings Settings for fog, HalosFlares and Cookies.
Fog Enables or disables fog in the Scene. Note that fog is not available with the Deferred rendering path. For deferred rendering, the Global Fog effect may suit your needs.
    Color Set the color Unity uses to draw fog in the Scene.
    Mode Define the way in which the fogging accumulates with distance from the camera.
        Linear Fog density increases linearly with distance.
            Start Set the distance from the Camera at which the fog starts.
            End Set the distance from the Camera at which the fog completely obscures Scene GameObjects.
        Exponential Fog density increases exponentially with distance.
            Density Use this to control the density of the fog. The Fog appears more dense as the Density increases.
        Exponential Squared Fog density increases even faster than exponentially with distance (exponentially and squared).
            Density Use this to control the density of the fog. The Fog appears more dense as the Density increases.
Halo Texture Set the Texture you want to use for drawing a Halo around lights.
Halo Strength Define the visibility of halos around lights, from a value between 0 and 1.
Flare Fade Speed Define the time (in seconds) over which lens flares fade from view after initially appearing. This is set to 3 by default.
Flare Strength Define the visibility of lens flares from lights, from a value between 0 and 1.
Spot Cookie Set the Cookie texture you want to use for spot lights.

6、Debug settings

Property: Function:
Debug Settings Settings that help you debug your Scene.
Update Statistics If ticked, the statistics window at the bottom of the Lighting settings window is updated as the Scene changes. This can have an impact on performance during Play mode. For better performance in Play mode, untick this box.
Light Probe Visualization Use this to filter which Light Probes are visualized in the Scene view. The default value is Only Probes Used By Selection.
    Only Probes Used By Selection Only Light Probes that affect the current selection are visualized in the Scene view.
    All Probes No Cells All Light Probes are visualized in the Scene view.
    All Probes With Cells All Light Probes are visualized in the Scene view, and the tetrahedrons that are used for interpolation of Light Probe data are also displayed.
    None No Light Probes are visualized in the Scene view.
Display Weights When ticked, Unity draws a line from the Light Probe used for the active selection to the positions on the tetrahedra used for interpolation. This is a way to debug probe interpolation and placement problems.
Display Occlusion When ticked, Unity displays occlusion data for Light Probes if the Mixed lighting mode is Distance Shadowmask or Shadowmask.

三、Global maps tab

时间: 2024-07-31 06:44:57

Unity 编辑器学习(二)之 全局光照(GI)的相关文章

Unity 5 全局光照GI与新的烘焙系统初探

GI是啥 Realtime GI,实时全局光照,听上去就是一个非常高大上的词,但是越高大上就越令人心生敬畏,因为世上没有免费的午餐,越好的效果意味着越多的消耗,对于移动平台来说,这样的消耗受不受的起呢?首先来说说GI是干啥的,非常粗略的来描述下,如果说我们以前的光照系统就是由光源 - 物体 - 视点组成的话,那么全局光照系统就是由光源 - n多环境反射光 - 物体 - 视点.就是说GI额外包括了环境反射光的计算,它可以使得渲染出来的场景物体间的光影交互更为真实. 如果是离线烘焙的话,n多的环境反

unity编辑器学习,创建自己的窗口

又是一个体力活,资源搬家的.具体的任务我就不透漏了,反正是底层的资管管理之类的东东. 为了简化操作,我还是坚持写了一个插件,然后感觉做个自己的小窗口也不错,就写了个小小的编辑器插件. OK,这个小窗口完成的功能很简单,就是移动资源到某一文件夹的.好了,代码分享如下, 看效果的话,直接放到项目文件里面重启unity就行了.代码很简单,注释就不写了: using System; using System.Collections.Generic; using System.Linq; using Sy

Unity 5 中的全局光照技术详解 (转载)

原文链接 本文整理自Unity全球官方网站,原文:UNITY 5 - LIGHTING AND RENDERING (文章较长,请耐心阅读)简介全局光照,简称GI,是一个用来模拟光的互动和反弹等复杂行为的算法,要精确的仿真全局光照非常有挑战性,付出的代价也高,正因为如此,现代游戏会先一定程度的预先处理这些计算,而非游戏执行时实时运算. 同一场景里:没有照明(左),只有直接光源(中),和有间接光源的全局光照(右)的表现,注意颜色如何在不同的表面进行光的"反弹",产生更真实的结果. 在本文

Unity 5 中的全局光照技术详解(建议收藏)

2015-07-01 10:43 编辑: cocopeng 分类:游戏开发 来源:Unity全球官方网站 1 47108 Unity 5全局光照技术 招聘信息: 资深软件研发工程师 嵌入式软件工程师 cocos2d-x休闲游戏开发 产品经理 Cocos2d-x游戏客户端开发 Java工程师 Cocos2d-x js高级开发工程师 Mac开发 应用开发工程师(iOS) 技术合伙人-后端工程师 高级iOS开发工程师 本文整理自Unity全球官方网站,原文:UNITY 5 - LIGHTING AND

Unity 5 中的全局光照技术详解

简介 全局光照,简称GI,是一个用来模拟光的互动和反弹等复杂行为的算法,要精确的仿真全局光照非常有挑战性,付出的代价也高,正因为如此,现代游戏会先一定程度的预先处理这些计算,而非游戏执行时实时运算. 同一场景里:没有照明(左),只有直接光源(中),和有间接光源的全局光照(右)的表现,注意颜色如何在不同的表面进行光的"反弹",产生更真实的结果. 在本文中,我们会描述全局光照如何在Unity里运作,带领你通过不同的照明技术解释如何在项目里设定照明,并思考如何透过各种工具帮场景打光. 选择一

全局光照:光线追踪、路径追踪与GI技术进化编年史

全局光照(Global Illumination,简称 GI), 作为图形学中比较酷的概念之一,是指既考虑场景中来自光源的直接光照,又考虑经过场景中其他物体反射后的间接光照的一种渲染技术. 大家常听到的光线追踪,路径追踪等同样很酷的概念,都是全局光照中人气较高的算法流派. 而这篇文章将围绕全局光照技术,介绍的要点有: 全局光照的基本概念 全局光照的算法主要流派 全局光照技术进化编年史 光线追踪 Ray Tracing 路径追踪 Path Tracing 光线追踪.路径追踪.光线投射的区别 环境光

Unity预计算全局光照的学习(速度优化,LightProbe,LPPV)

1.基本参数与使用 1.1 常规介绍 使用预计算光照需要在Window/Lighting面板下找到预计算光照选项,保持勾选预计算光照并保证场景中有一个光照静态的物体 此时在编辑器内构建后,预计算光照开始生效. 相关的文章有很多,unity官方有一系列文章不错: https://unity3d.com/cn/learn/tutorials/topics/graphics/introduction-precomputed-realtime-gi 在Lighting面板的Scene页签下可以设置全局光

Unity编辑器中光照贴图背后的PowerVR光线追踪技术

今年八月,大量的游戏开发者走进Unite 2014,齐聚在西雅图中心参加Unite第八届年度会议.在一系列令人兴奋的会议以及主题演讲中,来自我们PowerVR光线追踪团队的Jens Fursund介绍了即将推出的Unity 5光照贴图编辑器,使用光线追踪技术以快速.准确地模拟光照. 我们非常高兴与Unity的合作,在最近的展示和活动中,我们已经从观看该工具演示的一些开发者中得到很多积极反馈. 让我们来快速浏览一下PowerVR光线追踪技术如何通过新光照贴图编辑器助力开发人员和艺术家加快作品开发.

【Unity灯光与渲染技术】Global Illumination全局光照

本系列主要参考Unity灯光与渲染技术教程Unity Lighting And Rendering,同时会加上一点个人实践过程和理解. ========================================== 分割线 ========================================== 这篇文章主要讲全局光照,在看教程的时候就有一个点不是很理解,就是作者开启物体的static这个选项.在网上查找一些资料,有的说"static表示物体时静态的,多用于静止不动的物体,此外