keywords:UE4, Lighting, 灯光, 光源距离裁剪


Fragments Notes

Lighting Channels

假设场景中只有一个平行光,且光照强度较大时,那么角色身上接收不到直接光照的部位(比如脖子),会明显发黑,如果增大 SkyBox 光照强度,那么会影响整个场景的亮度。有没办法只增加角色身上的光照亮度?让阴影区域变亮?解决办法是:Lighting Channels。
场景中添加两个平行光,A平行光的 Lighting Channels 只开启Channel 0,B平行光只开启Channel 1,然后角色的 Mesh 同时开启 Channel 0 和 Channel 1。


  • Lighting Channels是动态的,意思是:静态光(Static Lights)或者Mobility为Static的Static Mesh Actor不受Lighting Channels影响。要使用Lighting Channels,Static Mesh Actor和Lights的Mobility必须设置为Stationary或者Movable。
  • 材质类型影响:Lighting Channels只影响直接光照(direct lighting)下Opaque类型材质,Translucent或者Masked类型材质没有效果。
  • Lighting Channels对性能开销不大,可以忽略不计。

移动端的Lighting Channels:

  • 4.13版本开始,才支持移动端的Lighting Channel。
  • 移动端多个Directional Light支持不同Lighting Channels。
  • 一个Primitives只受一个Directional Light影响,如果primitves勾选了多个Lighting Channel,那么只会启用第一个。
  • CSM Shadows只会投射到与光源Lighting Channels相同的primitives上。
  • 动态点光源在移动端支持Lighting Channels的所有特性,与桌面级特性相同。

另外:Lighting Channels不支持运行时修改,就是说Lighting Channels在Actor创建时(比如BeginPlay)设置好以后,之后就无法再修改。

If Character is dark even give it dedicated Light Channel, the reason maybe is: there’re some objects casting shadows on the Character, you can disable Cast Shadow on these objects.

Occlusion Culling

Project Settings -》 Engine -》 Rendering -》 Culling -》 Min Screen Radius for Lights

Lights view distance

Ambient Occlusion

DFAO can be used with precomputed lighting, but SSAO can not. DFAO can save GPU cost but memory usage would increase.

Cheap Ambient Lighting System

Ambient Occlusion quality command for mobile:

static TAutoConsoleVariable<int32> CVarMobileAmbientOcclusionQuality(
    TEXT("The quality of screen space ambient occlusion on mobile platform.\n")
    TEXT("0: Disabled.\n")
    TEXT("1: Low.(Default)\n")
    TEXT("2: Medium.\n")
    TEXT("3: High.\n"),
    ECVF_Scalability | ECVF_RenderThreadSafe
Screen Space Ambient Occlusion (SSAO)

Ambient Occlusion

Distance Field Ambient Occlusion (DFAO)

How to enable DFAO

  1. Start by navigating to the Modes window, then in the Lights section, select and drag a Sky Light into the Level Viewport.
  2. With the Sky Light selected, navigate over to its Details panel and set its Mobility to Movable.
  3. Project Settings -> Engine -> Rendering -> Default Settings -> check Ambient Occlusion
    Place a post process volume into your level, enable Unbound in it’s properties and then modify Intensity of AO intensity.
  4. Project Settings -> Engine -> Rendering -> Lighting -> check Generate Mesh Distance Fields

Distance Field Ambient Occlusion

Using Distance Field Ambient Occlusion

Mesh Distance Fields

Screen Space Global Illumination (SSGI)

How to enable SSGI:
Project Settings > Engine > Rendering -> Lighting -> Check Screen Space Global Illumination.

An overview of dynamic global illumination using a screen space effect.

UE4 4.24 SSGI + AO Implementation

Area Lights

Simulating Area Lights in UE4

Light Texture

LIGHT TEXTURE (UE4) Unreal Engine


Reflections (Part 1) Cube Map Reflections | Tips & Tricks | Unreal Engine

Reflections (Part 2) Planar Reflections & SSR | Tips & Tricks | Unreal Engine

Fragments Notes: Lighting on Mobile

Attentions on Mobile

1, Static and Stationary Spotlight support on Mobile, but Movable Spotlight not support on Mobile before v4.22;

2, Movable Pointlight support on Mobile always;

3, Testing in v4.21: Static and Stationary Point Light not work on Android Vulkan without building lighting. Solution: Setting up your lighting in SM5, then building lighting, then switch to Android Vulkan, when start game, lighting would works right.

Reflection on Mobile

I did do some testing and was able to get the reflective environment to work on my end, but my results were not incredibly strong. Screen Space Reflections are unsupported on Mobile so that is expected no to work. You will want to make sure your ‘Skylight’ is set to ‘Static’ and ‘Cast Shadows’ is unchecked. Project Settings > Rendering > Mobile HDR is enabled. Then rebuild with Production quality lighting.


Lighting Issues

Fragments Issues

Issue 1:
Point Light intensity is very low event set Intensity to large value.
Remove Point Light and add a new Point Light into scene and setting up it.

Issue 2:
There’re some strange block on lightmaps even building lighting again.
Build -> Lighting Quality -> Production, then building lighting again. There’re some bug in Preview level of Lighting Quality.

Issue 3:
There’re some seams on the junction of two StaticMeshActor after lighting building.
Rotating the StaticMesh 180 degrees, or up lightmap resolution to 128 rather than 64, or disable cascaded shadow maps and use either the Detail Lighting or Lighting Only view modes to see the baked result.

Issue 4:
There’re some strange gree block on meshes when Sky Light switch from Stationary to Movable (e.g. Turning DFAO on).

Create a Level and enable Movable Sky Light at first, then copy meshes into the new Level.

Issue: shadows disappeared when the distance between Actor and Camera increased

This issue is affected by two factors:

  1. DirectionalLight’s perperty Dynamic Shadow Distance, if this value is less than the distance between Actor and Camera, shadows would disappeared.

  2. Engine’s parameter r.Shadow.RadiusThreshold,which means shadow visibility at camera distances, there’re two ways to change this parameter:

    • For Editor: Settings -> Engine Scalability Settings -> Shadow.
    • For Run-time: UKismetSystemLibrary::ExecuteConsoleCommand(GetWorld(), TEXT("r.Shadow.RadiusThreshold 0.06"));


Lighting Troubleshooting Guide



Offical Documents

Lighting Content Examples

Light Propagation Volumes

Lighting for Mobile Platforms


Dynamic GI : Getting the Most out of LPV ( Light Propagation Volume )

Lighting Passes

Unreal Engine 4 的 光和影

[UE4] Let’s organize Light’s Mobility

[UE4] Adjust Volumetric Lightmap by playing with lightmass.ini

[UE4] Create a lightmap for moving objects with Static Lighting


Fragments Tutorials

Tutorial | UE4 Lighting Overview

Studying Lighting in Games

Lighting A Scene From Scratch - #19 Unreal Engine 4 Level Design Tutorial Series

Create photoreal cinematics in UE4: Rebirth tutorial

How To Set Up A Realistic Post Process - UE4 Tutorial

Lighting with EMISSIVE Materials in UE4 - Unreal Engine Tutorial

UE4 Emissive Tutorial Example Files

Lighting Detailed Interiors + Q&A [Unreal Engine 4]

80 Level Ratings: 10 Excellent Tutorials on Lighting in Unreal

Fog & Volumetric Tutorials

UE4 Lighting and Fog tutorial | ArtStation Challenge EP.006

Volumetric Fog and Lighting in Unreal Engine 4 | GDC 2018 | Unreal Engine

UE4 God Rays and Volumetric Fog Tutorial

Lighting Tricks

Hiding in Shadows (Stealth) - Unreal Engine 4 Tutorial

[Unreal Engine 4] - Top 5 Light Tips And Tricks

Lighting in Unreal Engine 5 for Beginners

Exterior Lighting

How To Light Exteriors - Dynamic Lighting [Unreal Engine 4 Tutorial]


How To Improve Your Lighting w/ RTXGI