Unity 2018.1.2f1

原文链接:https://www.youtube.com/watch?v=VnG2gOKV9dw

Unity Lighting练习最终效果

Unity Lighting(一)光照练习-LMLPHP

眼睛、光源与物体

Unity Lighting(一)光照练习-LMLPHP

光学基础知识

Unity Lighting(一)光照练习-LMLPHP

透射、反射、折射、衍射、吸收、散射

Unity Lighting(一)光照练习-LMLPHP

直接光照与间接光照

Unity Lighting(一)光照练习-LMLPHP

间接光照:光线经过多次反弹后进入眼睛

Unity Lighting(一)光照练习-LMLPHP

Unity内置两种Lightmapper:

1. Progressive lightmapper, 是一个无偏差的蒙特卡罗路径跟踪器,仅支持 Baked GI
2. Enlighten lightmapper, 由Geomerics开发的光照系统,主要用于支持 Realtime GI

Unity默认使用Progressive Lightmapper;

Unity Lighting光照练习详细步骤

一、基础设定

新建工程,新建场景;

在场景中放入Room与Monkey模型;

关闭默认的Directional Light;

Unity Lighting(一)光照练习-LMLPHP

二、添加光源

在场景中添加两个平面,给平面赋予自发光的材质作为场景中的光源;

OrangeLight材质:Emission Color = FFA400, intensity = 1.5

BlueLight材质:Emission Color = 00CAFF, intensity = 2

将模型与光源物体都设置为static(Room,Monkey,OrangeLight,BlueLight);

Unity Lighting(一)光照练习-LMLPHP

三、Lighting Settings

移除Skybox,环境光设置为纯黑;

Lightmapper设置为Progressive;

关闭Realtime GI,同时Clear Baked Data;

自发光材质Global Illumination = Baked;

Unity Lighting(一)光照练习-LMLPHP

Unity Lighting(一)光照练习-LMLPHP

No Skybox + Ambient Color = Pure Black + Emssion materials + Baked GI(Progressive Lightmapper)

Unity Lighting(一)光照练习-LMLPHP

拼接缝隙(Stitch Seams)

降低Lightmap Size = 512,以减少存储空间;

关闭Compress Lightmaps,可以提升画面质量;

Unity Lighting(一)光照练习-LMLPHP

开启Ambient Occlusion: Indirect Contribution = 0.1

Unity Lighting(一)光照练习-LMLPHP

四、Post-porcessing Effects

在Project Settings当中,设置 Color Space = Linear;

使用Package manager安装Post processing;

在Camera上面添加组件Post Process Layer;设置Layer为PostPorcessing;

Unity Lighting(一)光照练习-LMLPHP

创建Post-process Volume:GameObject -> 3D Object -> Post-process Volume;

a) 设置Layer = PostProcessing
b) Add Bloom effect: Intensity = 5, Threshold = 1, Diffusion = 5.5
c) Add Color Grading effect: Mode = ACES
d) Add Vignette effect: Intensity = 0.45

Unity Lighting(一)光照练习-LMLPHP

Unity Lighting(一)光照练习-LMLPHP

最终效果

05-11 18:08