From the course: Unreal Engine: Global Illumination for Architectural Visualization

Understanding light baking - Unreal Engine Tutorial

From the course: Unreal Engine: Global Illumination for Architectural Visualization

Start my 1-month free trial

Understanding light baking

- For anyone wanting to start working with global illumination in Unreal, be they brand new to CG lighting, or having come to Unreal with an already working knowledge of offline renderers, there are definitely workflows and terminology that need to be understood, at least in the basic sense, before being able to be properly utilized. And so in this particular video, I just want to go over a quick explanation of exactly what light baking is and why Unreal uses it. To do that though we need to understand a little bit about the history or the background of rendering in game, or realtime engines, and more specifically the difference between the traditional choices of forward and deferred rendering. You see, initially, most realtime engines utilized what is called forward rendering, a technique whereby each object in a scene gets rendered in a pass for each of the lights that are affecting it. Meaning each object in the scene could end up being rendered multiple times depending on the number of lights that are within range of it. The advantage of this approach is that it can be very fast, meaning that hardware requirements are considerably lower than using alternative methods. Additionally, forward rendering also allows for the use of a wide range of shading models and can also handle transparency quickly. It even allows for the use of hardware techniques like Multi Sample Anti Aliasing, or MSAA, which are not available in alternatives such as deferred rendering, this having quite a significant impact on final image quality. A significant disadvantage to the way in which the forward approach works though, is the fact that you do have to pay that render cost on a per light basis, so the more lights affecting each object in the scene, the slower the performance becomes. For levels containing lots of lights, this can of course become a big problem. Where it possible to carefully manage light counts in a scene though, forward rendering can actually be a very fast solution. Deferred rendering on the other hand, defers, hence the clever name, the shading and blending of lighting information until after the first pass, during which positions, normals, and materials for each surface in the scene are rendered to a geometry buffer, or G-buffer for short, this being done as a series of screen-space texture maps. These are then composited together with the already baked lighting pass, meaning that the render cost of lighting is actually proportional to the number of pixels that the light illuminates rather than the number of lights themselves. This in turn means that we're no longer limited in the number of lights that we can render on screen, which for some levels may be a critical advantage. Light Baking, or building then, is simply that part of the deferred rendering process during which a scene's lighting, both direct and indirect, gets calculated, rendered to bitmaps, and then composited together with all of the G-buffer textures, that are then rendered in order to produce the final, realtime image that we see as we play through a level. To sum up then, Light Baking as a part of the deferred rendering workflow, has traditionally offered better lighting quality and better engine performance, than the forward rendering alternative albeit of course with a few significant caveats.

Contents