Lumen brings real-time global illumination to Fortnite Battle Royale Chapter 4

Daniel Wright, Engineering Fellow, Graphics and Krzysztof Narkowicz, Technical Director, Graphics |
January 26, 2023
Hi, we're Daniel Wright and Krzysztof Narkowicz, engineers working on Lumen. Lumen is Unreal Engine 5's fully dynamic global illumination and reflections system, which is enabled out of the box. In this blog post, we’re going to take you through how Lumen is working in Fortnite Battle Royale Chapter 4, and highlight the improvements the team made to Lumen while shipping Chapter 4 (which are now available to all developers in Unreal Engine 5.1). We also wrote an earlier tech blog introducing Lumen that we highly recommend reading for a general overview of the system.

Fortnite Battle Royale Chapter 4 ships with Lumen enabled on Playstation 5, Xbox Series X and Xbox Series S. Lumen is enabled on PC and cloud gaming whenever the “Global Illumination” quality setting is set to “High” or “Epic,” with an option to use hardware ray tracing for even greater quality where supported by the video card.
 

Lumen in Fortnite Battle Royale Chapter 4

Before Chapter 4, Fortnite was limited to Unreal Engine 4’s dynamic lighting technologies on next-generation consoles. Only Distance Field Ambient Occlusion was used for ambient lighting, causing interiors to feel cold as the blue skylight leaks into buildings. In Chapter 4, Lumen calculates global illumination at high quality, adding back the warm sunlight bounce and detailed indirect shadows.
Distance Field Ambient Occlusion vs Lumen Global Illumination. Auto Exposure is enabled together with Lumen GI.
Indoor areas become significantly darker than outdoors with accurate global illumination, as the skylight is correctly blocked, which requires Automatic Exposure to be enabled.

In earlier versions of Fortnite, reflections on next-generation consoles were limited to Screen Space Reflections (SSR). This effect can only reflect what’s on screen, which is not enough to prevent skylight from leaking when inside a building. SSR also only provides good results on mirror surfaces, so rough reflections were lacking. Fortnite artists had been working around these limitations by almost completely avoiding specular on materials used indoors! Lumen Reflections provide accurate ray-traced reflections on glossy surfaces, rendering metals and smooth materials correctly even when they are indoors. Artists can now see the full material response to lighting in real time.
Screen Space Reflections vs Lumen Reflections on ice.
Lumen Reflections are also prevalent on water, where they are much sharper than SSR, and not limited to reflecting what’s visible on the screen.
Screen Space Reflections vs Lumen Reflections on water.
Fortnite Battle Royale has many game events that require dynamic lighting—the time of day will change, players can build and destroy structures, open doors, and so on. Lumen is fully dynamic and reacts to these changes in real time. Lumen does amortize its calculations across multiple frames to reduce cost, but with the high frame rate that Fortnite targets, temporal accumulation artifacts are minimized.

Journey to Chapter 4

As we wrapped up work on the Unreal Engine 5.0 release, our focus turned to Fortnite Battle Royale Chapter 4 and its challenges. Fortnite targets a minimum of 60 fps on consoles, which is only 16.67 milliseconds per frame, or even less with headroom for dynamic resolution and gameplay costs during heavy combat. Considering all of the rendering features that we wanted, we were only going to have four milliseconds for dynamic global illumination and reflections combined. This is an extremely small budget as—it’s common for triple-A games to spend four milliseconds on ray-traced reflections alone. We were going to have to make every optimization possible while not compromising on next-generation lighting quality.

The first thing we had to decide was which ray tracing method to use for Fortnite Battle Royale Chapter 4. We had already shipped The Matrix Awakens: an Unreal Engine 5 Experience with Lumen using hardware ray tracing on consoles, having made significant optimizations, but that tech demo had a 30 fps budget. After some early tests, we determined that Lumen’s software ray tracing was required to hit the 60 fps budget due to its lower tracing costs. But the approximate nature of software ray tracing introduced several challenges—particularly around foliage quality and water reflections.

Fortnite Battle Royale Chapter 4 has forests and rolling hills covered by grass. None of the previous projects that we shipped Lumen in had significant foliage, so we hadn’t had a chance to work on it yet. One of the big problems was over-occlusion on foliage.

Lumen’s software ray tracing uses a Global Signed Distance Field to represent the scene’s surfaces. Signed Distance Fields can only represent an opaque surface, and ray marching them gives a binary result: hit or miss. This causes severe over-occlusion on foliage meshes, which are modeled as aggregates. We developed a new way to intersect Signed Distance Fields—a choice is made at each step of the ray marching whether to intersect. This made it a stochastic technique, and allowed us to more accurately model the aggregate geometry while keeping the Signed Distance Field representation that works well for the rest of the scene.
Over-occlusion on foliage solved with semi-transparent stochastic distance field intersections.
Some problems were easier to solve. Lumen uses screen traces to add detail where software ray tracing is lacking, but grass is so detailed that these screen traces were introducing significant aliasing. A simple workaround to skip screen trace hits on foliage was enough to solve the artifacts.
Extreme noise from screen traces on grass solved by skipping foliage hits.
Another big issue with software ray tracing was the low resolution of lighting cached on surfaces seen in reflections. Lumen maintains a fairly high-resolution Surface Cache for each mesh to efficiently provide lighting for ray hits, but we were merging them to a voxelized representation that was much blurrier. We developed a reverse lookup structure which allowed us to sample the per-mesh Surface Cache directly on ray hits, giving much more accurate emissive lighting and sharper water reflections.
Sharper reflections with software ray tracing when rays sample Lumen’s Surface Cache directly (screen traces disabled for visualization).
On the topic of water reflections, we had vertical streaking artifacts wherever Lumen’s screen traces were interrupted by a foreground object. This was incredibly distracting for a character in motion. Lumen’s screen traces don’t know how thick an object is, so we have to switch to software ray tracing for the rest of the ray, which often produces a different color. This was a regression over even Screen Space Reflections, which used a much cheaper but less accurate method of intersecting rays, but allowed continuing behind foreground objects. We were able to solve the vertical streaks by sampling the screen color even for software ray tracing hits, which reduces the mismatch. This one came in at the absolute last minute so it was not part of the UE 5.1 release.
Vertical streaks caused by the mismatch between screen traces and software ray traces minimized by sampling the screen color at the ray hit.
Other quality improvements came by surprise. Lumen GI downsamples heavily in order to fit into a four millisecond budget. This makes noise more noticeable, distracting from the game experience. We were able to reduce noise greatly by integrating NVIDIA’s Spatiotemporal Blue Noise, a technique that pre-optimizes noise patterns to cancel out quickly when accumulated over multiple frames. This gave much cleaner indirect lighting without requiring any more rays to be traced.
Sky lighting entering the door has less noise with Spatiotemporal Blue Noise.

Art direction controls

Artists already have some tools to art direct indirect lighting, like “Indirect Lighting Intensity” on the directional light. Fortnite artists used a value of 2.0 to amplify bounced lighting and give the game a warmer feel. Indoor areas presented a problem though: they became extremely dark with accurate global illumination when there were no windows or light sources nearby. This caused huge swings in exposure when going from indoors to outdoors. Artists could work around it by placing more light sources, but that would increase shadowing costs.

We developed new controls over Lumen’s indirect lighting: “Skylight Leaking” and “Diffuse Color Boost” on the Post Process Volume. “Skylight leaking” can be used to add a small amount of ambient lighting indoors, limiting the exposure range, while “Diffuse Color Boost” can be used to amplify the amount of multi-bounce indirect lighting. Neither of these options add any significant GPU cost, unlike adding more lights. Fortnite artists ended up using skylight leaking to prevent indoor areas from becoming too dark for gameplay purposes.
Skylight leaking used to prevent areas from going full black.
Accurate global illumination creates high-contrast lighting where no single exposure value works well. Bright areas of the image—especially the sky and any surfaces lit by the sun—are blown out, while dark areas are underexposed. Unreal Engine 5.0 introduced a new feature called Local Exposure, which Fortnite artists used to preserve highlight and shadow detail in these challenging high dynamic range lighting conditions.
Highlight and shadow detail preserved with Local Exposure, a new feature in UE 5.0. Local Exposure should always be set up when using Lumen!

Performance

Lumen relies heavily on Temporal Upsampling with Unreal Engine 5’s Temporal Super Resolution (TSR) for 4K output. Rendering at 1080p internally with TSR gives the best final image quality, instead of running Lumen at 4K natively with significantly lower quality settings.

Lumen can be configured to target 60 fps on next-generation consoles by setting the “Global Illumination” and “Reflection” quality groups to “High” in the platform’s device profile:

; Set Lumen GI and reflection quality to High, targeting 60 fps
+CVars=sg.GlobalIlluminationQuality=2
+CVars=sg.ReflectionQuality=2

Lumen GI scales down by downsampling even more heavily than normal, going down to 1/16th of a ray per pixel. Indirect lighting becomes less temporally stable when tracing so few rays, and noise becomes more noticeable in dark areas. Skylight leaking is a useful tool for hiding this increased noise.
Lumen on 60 fps settings vs Lumen on 30 fps settings. Lumen captures small details better and is much more temporally stable on 30 fps settings, which doesn’t come across in a screenshot comparison.
We made a lot of small optimizations to Lumen GI while working on Fortnite Battle Royale Chapter 4, but the biggest speedup came by moving the entire method to the async compute pipeline, saving 0.8 milliseconds. Lumen has many compute dispatches for its various algorithms, between which the GPU is idle for a short time, but they add up.

Additionally, ray tracing dispatches tend to have long tails where a few rays take much longer to complete than the rest. Moving this work to the async compute pipeline allows the GPU to fill in the gaps with the rest of the frame’s work, making better use of the GPU’s processing power. Async Lumen will be enabled by default on consoles in UE 5.2, as some fixes were required that didn’t make it in time for UE 5.1.
Lumen’s work is now on the async compute pipeline, making better use of the GPU’s computational power.
Lumen Reflections scale down to the 60 fps budget by rendering at half resolution, except on water. Lumen GI already produces rough reflections, but Lumen Reflections need to trace additional rays for sharp reflections. Reflection cost can vary widely depending on how much of the screen has smooth enough materials to need reflection rays. One of the biggest optimizations (one to two milliseconds) came from skipping reflection rays more often on foliage, which already has higher costs in the Base Pass and Shadow Depths and didn’t cause a noticeable quality loss.

Xbox Series S presents a special challenge. It has a four teraflop GPU versus the twelve teraflop GPU in Xbox Series X, so a lower internal resolution was going to be required, but that wasn’t enough. We didn’t want to fall back to Distance Field Ambient Occlusion, which significantly changes the look. Instead we developed a mode where Lumen GI provides rough reflections, and Screen Space Reflections are used for mirror reflections. This saves about one millisecond by disabling Lumen Reflections, but looks great compared to what you could achieve using just Screen Space Reflections.
Lumen Global Illumination provides rough reflections even when Lumen Reflections are disabled for scalability.
At the end of the day, we successfully fit Lumen GI and Reflections in our four millisecond average cost budget for 60 fps on next-generation consoles. Fortnite Battle Royale Chapter 4 achieves an average internal resolution of 55%-60% of 4k on next-generation consoles, while hitting 60fps reliably.

Scaling down

Fortnite ships on a wide range of platforms, and only the highest-end platforms support Lumen. The game experience needs to be as similar as possible, without requiring artists to relight per platform. We scale ambient lighting according to the “Global Illumination” quality setting:

Epic and High
  • Lumen is enabled, providing full global illumination
  • Lumen skylight leaking is in use, preventing dark areas from reaching full black
  • Automatic Exposure is enabled to give correct exposure indoors
  • Local Exposure is enabled

Medium
  • Distance Field Ambient Occlusion is enabled instead of Lumen for large-scale AO
  • Screen Space Ambient Occlusion is enabled for small-scale AO
  • Automatic exposure is disabled

Low
  • Unshadowed skylight
  • The skylight intensity is reduced with r.SkylightIntensityMultiplier=0.7 to match Medium better, since there’s no form of skylight shadowing

We hope this summary of Lumen improvements for Fortnite Battle Royale Chapter 4 was useful, and answered questions about how to ship a cross-platform game with Lumen. Unreal Engine developers can access the vast majority of these improvements already in Unreal Engine 5.1. For further information, check out the Lumen documentation.

    Get Unreal Engine today!

    Get the world’s most open and advanced creation tool.
    With every feature and full source code access included, Unreal Engine comes fully loaded out of the box.