笔者用的unity版本为2020.3.30f1c1,开一个HDRP模板场景,OK开始我们的操作。
第一步:删除场景中的所有东西只留下竹林玻璃房作为展示场景,将所有物体勾选Static,新增一个摄像机,如下图:
![](https://img-blog.csdnimg.cn/img_convert/ad24d553c1f73a98139bb8f5f25fc116.png)
第二步:GameObject > Volume > Sky and Fog Volume来创建一个自带环境光设置的Sky and Fog Volume,此时整个场景会变为全黑。设置Visual Environment-Type-HDRI Sky,勾选Ambient Mode,设置为Dynamic,模拟地球自然光效果,移除Physically Based Sky,然后在Add Override中添加Sky-HDRI Sky。HDRI Sky组件除了Enable Distortion不勾选,其他全部都选上,Hdri Sky选择一个默认天空盒即可,Intensity Mode选择Exposure,强度设置为14。然后在Add Override中添加Exposure,勾选Mode和Fixed Exposure,将Fixed Exposure设置为12。如此便完成了基础环境光得设置,如下图是窗口信息和场景效果:
![](https://img-blog.csdnimg.cn/img_convert/18c7ff2a0560023ec030d5eb0f2235b7.png)
![](https://img-blog.csdnimg.cn/img_convert/47040d6f879728f3a8f6247cd52dab34.png)
第三步:添加一个平行光Directional Light,参数设置如下图:
![](https://img-blog.csdnimg.cn/img_convert/f3d7f457fd981ab67069159dfb8ad08c.png)
![](https://img-blog.csdnimg.cn/img_convert/c0f9a1a59c6096abf7ae4e95b54ac6dd.png)
第四步:添加反射探针Reflection Probe,将整个玻璃房包裹住即可,点击反射探针上的bake,你可以发现玻璃上出现竹子的虚影。然后添加Light Probe Group,设置好光照探针组的位置。
![](https://img-blog.csdnimg.cn/img_convert/e20864ccbff06fb0c0a2cb84b8dadd13.png)
第五步:光照烘培,Lighting窗口Environment-Profile关联了当前场景所用的Volume Profile,并把HDRI Sky关联到Static Lighting Sky参数上。Lighting窗口Sceen-Lighting Settings选择New Lighting Settings新建一个灯光设置。点击烘培场景,灯光设置如下图所示设置:
![](https://img-blog.csdnimg.cn/img_convert/f0be2f6dbab1167cd9ddaf832cec62a1.png)
![](https://img-blog.csdnimg.cn/img_convert/a967c11e63a756558793b25cb4d2ba5c.png)
第六步:添加添加Fog(雾效),Shadows(平行光阴影控制),Contact Shadow(接触阴影)等其他效果,这些参数自行调整到一个个人认为好看的效果即可。
![](https://img-blog.csdnimg.cn/img_convert/8107a812dc80a66349bba05c1dbd8454.png)
![](https://img-blog.csdnimg.cn/img_convert/6e805f2215cd507bcdc2d051a21b4d80.png)
最后:设置自动曝光,一个室外白天自然光场景便完成了
![](https://img-blog.csdnimg.cn/img_convert/a781281c4587da1e7391e0a1b057eefd.png)
![](https://img-blog.csdnimg.cn/img_convert/fb26df47027aab010b503d98943073a0.png)