Lumen学习笔记

静态与动态光照效果

As the_sonnie briefly summarised, in order to be fast, lights which you’ve marked as not moving (static on stationary), are effectively “painted” on to non-moving surfaces as textures (these textures are known as lightmaps). This speeds up rendering as it doesn’t have to calculate this lighting each frame. This is known as “baking” or “building” the lighting.

Every time you change the static environment in the editor you’ll get a notice like this telling you your static lighting is out of date and needs to be recalculated.

When you build this lighting it will calculate the light bounces and shadows to build nice looking lighting, and draw this lighting onto the surface lightmaps. This process is a little expensive to do, so is only done on command when you finally want to see how things look; but as it’s precalculated it can do fancier things that aren’t normally done in dynamic lighting like correctly bounce around corners and stuff.

Lights that are marked as moveable (dynamic) can change with regard to geometry so they instead have to be calculated each frame by your graphics card. They may not have the same bounce detail as static lights, but these are the costs we pay.

不会移动的光照效果,预先通过烘焙(Baking/Building)生成为光照贴图(Lightmap),以提升运行时的性能;但是一旦你修改了场景内容(比如移动了光源、物体,或者修改了物体形状等),就得重新Build,即增加了开发阶段的耗时。

烘焙也是耗费CPU,但是整个过程不是一直满载CPU,中间CPU有降低到20%多的情况,猜测和烘焙流程有关系,不同阶段执行的操作不一样。另外,烘焙不怎么耗费GPU,GPU在烘焙过程中一直很空。

Build光照成本非常高,我给一个小场景重新构建光照,花了几个小时;设计师做3D视频,甚至要渲染好几天。

UE本身并不能解决渲染耗时过长的问题,UE的Lumen技术才是解决这个问题的关键。

Lumen是什么

Lumen是一套全动态全局光照解决方案,能够对场景和光照变化做出实时反应,且无需专门的光线追踪硬件。该系统能在宏大而精细的场景中渲染间接镜面反射和可以无限反弹的漫反射;小到毫米级、大到千米级,Lumen都能游刃有余。美术师和设计师们可以使用Lumen创建出更动态的场景,例如改变白天的日照角度,打开手电或在天花板上开个洞,系统会根据情况调整间接光照。Lumen的出现将为美术师省下大量的时间,大家无需因为在虚幻编辑器中移动了光源再等待光照贴图烘焙完成,也无需再编辑光照贴图UV。同时光照效果将和在主机上运行游戏时保持完全一致。

名词概念

GI(Global Illumination)

全局光照

DDGI(Dynamic Diffuse Global Illumination)

动态漫反射全局光照

Lumen in the Land of Nanite

参考资料

https://zhuanlan.zhihu.com/p/378119803

https://zhuanlan.zhihu.com/p/375981892

https://zhuanlan.zhihu.com/p/499713106

https://www.zhihu.com/question/394663572/answer/1221663839