Lumen

General Info

  • Surface Cache
    • Lumen generates an automatic parameterization of the nearby scene surfaces called the Surface Cache
    • It is used to quickly look up lighting at ray hit points in the scene
    • Lumen the captures the material properties for each mesh from multiple angles.
    • These capture positions called cards are generated offline for each mesh
  • Screen Tracing
    • Lumen features trace rays against the screen first
    • Before moving on to a more reliable method, if no hit is found or the ray passes behind a surface.
    • Supports any geometry type and is useful for covering up mismatches between the lumen scene and the triangle scene.
  • Ray Tracing
    • Software
      • Operates on the widest range of hardware and platforms
      • Works against signed distance fields, by default
      • This tracing representation is supported on any hardware supporting shader model 5
      • And only requires Generate Mesh Distance Fields to be enabled in the project settings
    • Hardware
      • Requires supported video cards and system to operate.
      • Supports a larger range of geometry types than software raytracing
      • In particular, it supports tracing against skinned meshes
      • Scales up better to higher qualities, because it intersects against the actual triangles and has the option to evaluate the lighting at the ray hit instead of the lower quality surface cache
      • Is the only way to achieve high-quality mirror reflections

Requirements

  • Requirements
    • General lumen & software raytracing
      • Support Shader Model 5
      • Direct3D 11 or higher
      • Does not supporyt mobile, no plan to support it
    • Hardware raytracing
      • DirectX 12 or later
      • Nvidia RTX 2000 or higher
      • AMD RX 6000 or higher

Settings

Lumen is enabled by default on all new projects in UE 5.
If you need to enable lumen on manually this is how you would do it:

  • Project Settings > Engine > Rendering >
    • Global Illumination >
      • Dynamic Global Illumination Method :
        • Lumen
    • Reflections >
      • Reflection Method :
        • Lumen
      • Reflection Capture Resolution :
        • 128 (default)
    • Lumen >
      • Use Hardware Ray Tracing when available :
        Will use HW raytracing (against..?) rather then SW against the surface cache.
        Note! Hardware ray tracing has significant scene update cost for scenes with more than 100k instances
        • Enable
      • Ray Lighting Mode :
        Controls how lumen reflection rays are lit when using HW ray tracing. By default lumen uses the surface cache for best performance, but can be set to “Hit Lighting” for higher quality.
        • Surface Cache (faster)
        • Hit Lighting for Reflections (higher quality)
      • Software Ray Tracing Mode :
        When SW ray tarcing is used will it use:
        • Detail Tracing (higher guality)
        • Global Tracing (faster)
    • Hardware Ray Tracing
      • Support Hardware Ray Tracing :
        Note! This needs to be enabled for the option to use HW raytracing when available to be used
        • Enable

Limitations

  • Lumen & Static lighting
    • Lumen GI can not be used togehter with static Lighting
      In fact it is better to disable the static lighting (se below in notes section)
  • Foliage
    • Is not very well supported at this time due to the heavy reliance on downsampled rendering and temporal filters.
    • Foliage must be enabled with the affect distance field lighting from the foliage tool settings.
    • Transparent objects are ignored by distance fields
    • Masked material will be treated as opaque, which can cause significant over shadowing on folaige, which leaves large areas of leaves masked out.
  • Moving Objetcs
    • Lumens final gather have significant noise around moving objects nad is under development
  • Translucency
    • Reflections are not yet supported
    • Will not have high quality GI
  • Software Ray tracing
    • Only static meshes, instanced static meshes, hierarchical instanced SM and landscape are represented in a lumen scene.
  • Materials
    • World position is not supported
  • Hardware Ray Tracing
    • Significant scene setup cost in large scenes
    • Tracing becomes very expensive with many overlapping meshes
    • Dynamically deforming meshes, like skinned meshes also incur a large cost to update the ray tracing acceleration structures each frame, proportional to the number of skinned triangles.

Note!

  • Disable Pre Computed lighting
    • When Lumen is used pre computed lighting from static lighting is removed.
    • You can disable static lighting entirely from the project by:
      • Project Settings > Engine > Rendering > Misc Lighting > Allow Static Lighting : Disable
      • By doing so it saves us from some static lighting overhead with shader permutations…
      • It will also allow for shader Ambient Occlusion input
      • And allow material bent normals to work with lumen global illumination
      • No more light map build times
  • Post Process Volume
    • Can override the Global illumination and Reflection method.
  • Software Ray tracing
    • Requires levels to be made of modular pieces i.e. walls, floors, ceilings etc should be sepatare meshes
    • Large meshes like mountains will have poor representation and may cause sel-occlusion artifacts
    • Walls should be no thinner than 10 cm
  • Distance Field
    • Mesh distance field resolution is based on the imported scale of the static mesh.
      • A mesh taht is imported very small and scaled up, will not have sufficient resolution
      • In the static mesh editor you can see the Transform > Import Unform Scale
      • In the static mesh editor you can use the Mesh > Distance Field Resolution Scale to compensate for a small scale import tthat has been scaled up (maybe better to import at the right size I guess…)
    • Distance field can not represent extremely thin features…
    • Or one sided meshes seen from behind. Make sure the viewer never sees the back side.
  • Nanite & Hardware raytracing
    • Fallback Triangle Percent
      • Can only operate on the proxy mesh
      • So if you have mismatches, you might have to increase the Nanite Settings > Fallback Triangle Percent of the SM. You do this in the Static mesh editor. Remember to click the Apply Changes button!
      • To view the nanite fallback mesh, in the static mesh editor under Show > Nanite Fallback you can choose to view it
    • Fallback Relative Error
      • Screen traces are used to cover the missmatch between the full triangle mesh rendered by nanite and the fallback mesh being ray traced by lumen.
      • In some cases the mismatch is to large to be hidden
      • In theese cases raising the fallback relative error can reduce incorect self-intersection artifacts

Common Problems

  • Indirect Lighting problem
    • If we have a problem with a mesh it can often be fixed by tweaking the detials of the mesh
      • Select the mesh
      • if we use Software ray tracing
        • Details > Lighting >
          • Affect Distance Field Lighting : off
            The mesh will no longer be a part of the software ray tracing
      • if we use Hardware ray tracing
        • Details > Rendering >
          • Visible in Raytracing : off
            The mesh will no longer be a part of the software ray tracing
  • Small meshes are black in reflections
    • Post Process Volume > Global Illumination > Lumen Global Illumination
      • Lumen Scene Detail : increase to higher value
  • Include small objects in the surface cache
    • If objects are to small it will not contribute to the lumen surface cach
    • to fix this we can enable Details > Lighting >
      • Emissive Light Source : on
        • This means the mesh will be part of the surface cache no matter of the size
        • The inteded use for this is if we have a smaller emissive light source this will force it to show up, but it also works for non emissive objects

Visualizing Lumen

  • Mesh Distance Field
    • Show > Visualize > Mesh Distance Fields
      This shows what the software ray tracer is tracing against
      • Gives a visual representation so that you can determine the accuracy / quality you wiull get from Lumen software ray tracer
      • If an item does not have the quality / fidelity you need
      • Open the mesh in the static mesh editor
      • Build Settings > Distance Field Resolution Scale
        In crease it and press apply changes. Note higher value obviously means more process time, so try to keep it at the minimum that you need to achieve the visual result required.
  • Lumen Overview
    • Lit > Lumen > Overview
      Displayes
      • Lumen Scene
        • Depending on if we use the software or hardware raytracer
      • Reflection View
        • The scene as the lumen reflection sees it
      • Surface Cache
      • The result
    • Lit > Lumen > Surface Cache
      • Pink
        Means the items have an issue, do not have enough surface cards or non at all. are to small to contribute to the Lumen surface cache
      • Yellow
        Means the items are not being used
  • Surface Cards
    • You can display the surface cards with this cvar:
      • r.Lumen.Visualize.CardPlacement = 1
    • if you need more cards on a mesh uou can open up the static mesh editor
      • Build Settings > Max Lumen Mesh Cards
        and set it higher (default is 12 and maximum is 32)

Resources