Lighting & Mobility
This article extends on the basic primer by further explaining the concepts in the title and how to use some of the tools and best practices.
You are reading an old article for Unreal Engine 4 - it should still work for Unreal Engine 5 though!
Overview
Lighting is a both a visual and technical process in Unreal Engine. Visually, lighting governs how the Level renders with lighting, but lighting itself can be a bottleneck to performance. This article will cover the types of lighting and lighting Mobility regarding performance and intended outcomes.
Types of Lights
Directional Light
Directional lights simulate light from a source that is infinitely far away where all the light rays are all parallel. This is commonly used for representing the sun.
Point Light
Point lights emit lights in all directions, they work like light bulbs.
Sky Light
Skylights capture distant parts of the level and re-project that as lighting. Used with Sky Spheres or HDRI backgrounds to simulate lighting.
Spot Light
Spotlights emit directional light from a single point in a cone shape. Commonly used as flashlights and downlights.
Rectangular light
Rectangular lights emits light from a rectangular frame.
Building Lighting
Lighting is one of the aspects that building is reliant on. Depending on the mobility of the light, it functions differently during play, which can have an effect on the intended experience. Below is a breakdown of all those qualities.
Mobility
The mobility setting controls whether an Actor can be changed in some way during play. For example, if an object can be affected by a physical force or if it will be lit appropriately by dynamic lights.
Quality: Direct and Indirect Lighting
Real light is commonly thought of as rays that bounce around until it hits your eyes. Baked lighting goes through this entire process, so all indirect light is accounted for as more light bounces are calculated, allowing for higher performance at high accuracy. When lighting is dynamic, it only calculates a single bounce before reaching your eyes, which is referred to as direct lighting, so while it can be dynamic, there is a cost in performance and is slightly less accurate. Dynamic lighting provides the most accurate light but is very expensive computationally.
Depending on how the project performs when playing, these trade-offs will need to be considered.
Quantity
Unreal Engine can only handle a limited number of Stationary lights in close proximity. As these types of lights update dynamically during play, in close proximity, concentrated lighting calculations will be too slow. When this happens, Unreal Engine will tag lights with a red cross. This distance is around 15m.
Consider switching out the Stationary light for a Static light. Alternatively, try switching to a single stationary light for overall dynamism, while the rest of the lights are Static.
Materials & Lightmaps
Lighting interacts with the level through its materials and lightmaps. Materials are formed by textures, and both textures and lightmaps need to be considered through a process called UV Unwrapping.
Shadows & Lightmap Resolution
As lightmaps are baked, the lightmap resolution determines the overall quality of these lightmaps. A Low resolution can make shadows and other effects appear inaccurate. This resolutions defaults to 64, and should be adjusted in factors of 2, e.g. 32, 64, 128, 256...
Last updated