The Rect Light emits light into the scene from a rectangular plane with a defined width and height. You can use them to simulate any kind of light sources that have rectangular areas, such as televisions or monitor screens, overhead lighting fixtures, or wall sconces.
RectLights do not behave like true area lights in all situations. See the discussion on mobility settings below.
Each Rect Light has two key settings, Source Width and Source Height, which determine the size of its rectangle along its local Y and Z axes:
The Rect Light has a spherical attenuation radius, like a Point Light or a Spot Light. As shown in the image above, the Rect Light emits light within its sphere of attenuation only in the positive direction of its local X axis, similar to a Spot Light with its cone set to 180 degrees. However, specular highlights for Rect Lights show the width and height of the light's rectangular area.
Like other types of light sources, Rect Lights have three Mobility settings:
Static: With this setting, the light's direct and indirect illumination are both baked to lightmaps when you build lighting for your level. This is the fastest method for rendering, but it means that the light cannot be changed in the game at runtime.
Stationary: With this setting, only the indirect illumination from the light is baked into lightmaps when you build lighting for your level. The direct lighting cast by the light is calculated dynamically every frame in the game. This setting preserves the high-quality soft shadowing and global illumination pre-computed by Lightmass, but it also permits you to change the color and intensity of the light in the game at runtime.
Movable: With this setting, the light is totally dynamic. None of its direct or indirect illumination is baked by Lightmass at all. This allows your light to cast correct shadows from moving objects in the game at runtime every frame. However, this setting is typically the slowest to render.
The mobility setting you choose also has a significant effect on the way the Rect Light casts light into the scene:
If your Rect Light is set to Static or Stationary, Lightmass takes the width and height of the light into account when it computes the illumination cast from the light source. For example, in the image on the left above, the light from the left and right extents of the rectangle reaches under the model and illuminates most of the floor.
In this case, the light emitted from the RectLight is sampled from multiple points across its rectangular surface. Each sampled light emits a fraction of the overall light intensity, so you can think of the RectLight as a simulation of many weak point lights distributed across the rectangular surface. The number of samples increases with the quality of your light build. Preview builds use few samples, so their shadows can look quite blocky. However, raising the quality setting eventually converges toward smoother results, as shown above.If you set your Rect Light to Stationary Mobility, you may be able to achieve better quality shadows by also enabling the Use Area Shadows for Stationary Light setting.
If your Rect Light is set to Movable, its diffuse and specular lighting are both calculated across the full width and height of the rectangle every frame. How soft its shadows look depends on the shadowing method. For example, ray traced shadows sample the whole rectangle.
Rect Lights that are set to Stationary or Movable are typically much more expensive to render than a Point Light or Spot Light with the same mobility. The exact cost scaling depends on the platform, but in general, Movable lights cost more than Stationary lights. The cost is also due in part to shadow casting, so you may be able to minimize the extra cost by turning off the Cast Shadows option. If your project uses MegaLights, many Movable Rect Lights can cast soft area shadows at a much lower cost. Alternatively, you could opt to set the mobility of the light to Static, which has no effect on runtime rendering performance at all.
Rect Light Properties
The properties of a Rect Light are broken up into the following categories: Light, Lightmass, Light Function, Light Profiles, Performance, and Distance Field Shadows.
Light
| Property | Description |
|---|---|
Intensity | The total energy that the light emits. Note that for Rect Lights, this value is averaged over the surface area of the light. As you increase the Source Width and Source Height of the light, you will need to increase the Intensity in order to maintain the same apparent brightness. The exception is when Intensity Units is set to Nits, where Intensity is the brightness of the surface, so a bigger light gives off more light. |
Light Color | The color that the light emits. |
Attenuation Radius | Bounds the light's visible influence. Like a Point Light or a Spot Light, a Rect Light has a spherical attenuation radius. |
Source Width | The extent of the Rect Light along its local Y axis. The default is 64, and the minimum is 1. |
Source Height | The extent of the Rect Light along its local Z axis. The default is 64, and the minimum is 1. |
Barn Door Angle | The angle of the barn door attached to the Rect Light, from 0 to 88 degrees. Lower values angle the doors forward to narrow the spread of light. At the default of 88 degrees, the barn doors have no effect. |
Barn Door Length | The length of the barn door attached to the Rect Light. The default is 20. |
Source Texture | Specifies a Texture that will be applied on the emitting rectangle. This Texture affects the color of the light emitted by the Rect Light, and is visible in specular reflections. Note, however, that this is only an approximation. It does not affect shadows cast by the Rect Light. Use an HDR image if possible, to avoid banding artifacts. Virtual textures aren't supported, so the asset picker doesn't list them. In addition, make sure that the Level of Detail > Mip Gen Settings option for your Texture is set to Blur5. |
Source Texture Scale | Scales the Source Texture on the rectangle, from 0 to 1. The default is 1. |
Source Texture Offset | Offsets the Source Texture on the rectangle, from 0 to 1. The default is 0. |
Temperature | The color temperature of the light, measured in Kelvin. |
Use Temperature | Determines whether or not the Temperature setting should apply to this light. |
Affects World | Enables and disables the light completely. Cannot be set at run time. To disable a light's effect during runtime, change its Visibility property. |
Cast Shadows | Determines whether or not the light casts shadows from objects in the Level. |
Indirect Lighting Intensity | Scales the indirect lighting contribution from the light. |
Volumetric Scattering Intensity | Scales the intensity and color of the volumetric scattering from this light. |
| Advanced Settings | |
Intensity Units | The units used for Intensity: Unitless, Candelas, Lumens, EV, or Nits. Changing the units converts the current value so the light's brightness stays the same. |
Specular Scale | Multiplier on Specular Highlights. Use only with great care! Any value besides 1 is not physical! Can be used to artistically remove highlights mimicking polarizing filters or photos touch up. |
Diffuse Scale | Multiplier on diffuse lighting. Use only with great care! Any value besides 1 is not physical! |
Shadow Resolution Scale | Scales the resolution of the shadowmaps used to calculate dynamic shadows cast by this light. By default, this value is computed based on the screen size of the shadow caster. Note that this value is capped by the value of the global r.Shadow.MaxResolution setting. |
Shadow Bias | Controls how accurate the shadows from this light are. |
Shadow Slope Bias | Works with Shadow Bias to control self-shadowing accuracy, adding more bias to surfaces at a steep angle to the light. |
Shadow Filter Sharpen | How much to sharpen shadow filtering for this light. |
Contact Shadow Length | The length of screen space to ray trace for sharp contact shadows. A value of zero disables this option. |
Contact Shadow Length in World Space Units | Determines whether the Contact Shadow Length setting is interpreted in world space units, or in screen space units. |
Contact Shadow Casting Intensity | Intensity of the contact shadows cast by primitives with Contact Shadow enabled. A value of 0 casts no shadow. |
Contact Shadow Non Casting Intensity | Intensity of the contact shadows cast by primitives with Contact Shadow disabled. A value of 0 casts no shadow. |
Cast Translucent Shadows | Determines whether this light is allowed to cast dynamic shadows through translucent objects. |
Cast Shadows from Cinematic Objects Only | Determines whether this light should cast shadows only from Components that have the Cast Cinematic Shadow option enabled. |
Force Cached Shadows for Movable Primitives | When enabled, this light will generate cached shadows for movable primitives even when the global r.shadow.cachedshadowscastfrommovableprimitives setting is disabled. |
Lighting Channels | Determines the lighting channels that this light should affect. |
View Lighting Channels | Controls which views this light affects. |
Cast Static Shadows | Determines whether this light should cast shadows from static objects. |
Cast Dynamic Shadows | Determines whether this light should cast shadows from movable objects. |
Affect Translucent Lighting | Determines whether this light should affect translucency. Disabling this setting may save some GPU time when your scene has many small lights. |
Transmission | Determines whether the light cast by this light source transmits through surfaces with subsurface scattering profiles. Requires the light to be Movable. |
Cast Volumetric Shadow | Determines whether this light source shadows volumetric fog. Disabling this can save GPU time. |
Cast Deep Shadow | Whether the light casts high quality self-shadowing on hair strands, at an extra GPU cost. |
Deep Shadow Layer Distribution | How the deep shadow layers used for hair strands are spread out, from 0 (evenly spaced) to 1 (exponential, which gives more detail on small nearby features). |
Cast Ray Traced Shadows | Whether the light casts ray traced shadows: Disabled, Use Project Setting, or Enabled. |
Affect Ray Tracing Reflections | Whether the light affects objects in ray traced reflections. |
Affect Ray Tracing Global Illumination | Whether the light affects ray traced global illumination. |
Allow MegaLights | Whether this light can use MegaLights when MegaLights is enabled in the project settings or a Post Process Volume. |
MegaLights Shadow Method | The shadowing method MegaLights uses for this light. Ray Tracing gives a fixed cost and correct area shadows. Virtual Shadow Map has a higher cost per light, but casts shadows directly from Nanite geometry. |
Inverse Exposure Blend | Blends between the light's intensity and its intensity divided by exposure. This keeps gameplay lights at a consistent brightness as the camera's exposure changes. |
Override Ray End Bias | Whether to use the Ray End Bias value on this light. |
Ray End Bias | Bias for the end of a shadow ray. Use it to fix self-occlusion artifacts between the light and nearby geometry, such as a lamp's enclosure mesh. |
Lightmass
The settings in this section are specific to the way this light is treated by the Lightmass global illumination system. They affect only the precomputed lighting from Static and Stationary lights.
| Property | Description |
|---|---|
Indirect Lighting Saturation | Determines the saturation of this light in baked lightmaps. A value of 0 completely desaturates this light; 1 leaves it unchanged. |
Shadow Exponent | Controls the falloff of shadow penumbras. |
Use Area Shadows for Stationary Light | Determines whether to use area shadows for stationary lights. This causes the shadows to get softer as the distance from the caster increases, but can require higher lightmap resolutions to get equally good results in places where the shadows are sharp |
Light Functions
Use the settings in this section to set up a Light Function for this light. Light functions aren't available on Static lights, and a Rect Light's light function isn't applied in volumetric fog.
| Property | Description |
|---|---|
Light Function Material | The light function material to be applied to this light. |
Light Function Scale | Scales the light function projection. |
Light Function Cone Angle | The cone angle used to project the light function material, from 0 to 89 degrees. A value of 0 uses an orthographic projection instead of a perspective one. Requires a Light Function Material. |
Fade Distance | The distance at which the light function should be completely faded to the value in Disabled Brightness. |
Disabled Brightness | Brightness factor applied to the light when the light function is specified but disabled — for example, when outside the maximum distance set by the Fade Distance setting above. |
Light Profiles
Use the settings in this section to set up an IES profile for this light.
Note that Rect Lights project their IES profiles from the center of the light, not along the edges of the light's rectangular area. This may produce unexpected results.
| Property | Description |
|---|---|
IES Texture | The IES Texture Asset assigned to the light's profile. Note that IES files are ASCII files, not image files, even though Unreal represents them as textures. |
Use IES Intensity | Determines the source of the light's brightness. Available only when an IES Texture is set. When this option is enabled, the light uses brightness set in the IES profile, in Lumens. When this option is disabled, the light uses its Intensity setting. |
IES Intensity Scale | Scales the brightness contribution when Use IES Intensity is enabled, to avoid the light overwhelming the scene. |
Performance
These settings fade out and stop rendering the light beyond a set distance from the camera. Use them to save the cost of lights that are too far away to make a visible difference.
| Property | Description |
|---|---|
Max Draw Distance | The distance from the camera at which the light stops rendering lighting and shadows. A value of 0 means there's no max draw distance. |
Max Distance Fade Range | The distance over which the light fades out as it approaches Max Draw Distance, so it doesn't pop. Requires Max Draw Distance to be greater than 0. |
Distance Field Shadows
These settings control ray traced distance field shadows, which use Mesh Distance Fields to cast soft area shadows with sharp contacts. They have a low cost for each object, so they work well for lights that affect many meshes.
| Property | Description |
|---|---|
Distance Field Shadows | Whether to use ray traced distance field area shadows. Requires Generate Mesh Distance Fields to be enabled in the project settings. |
Ray Start Offset Depth Scale | Controls how far ray traced shadows are offset from the receiving surface as the camera gets farther away. Larger values reduce self-shadowing artifacts on low-resolution distance fields. |
Ray Tracing
This setting controls the quality of the light's ray traced shadows, which are used when hardware ray tracing is enabled and Cast Ray Traced Shadows is on.
| Property | Description |
|---|---|
Samples Per Pixel | The number of rays traced for each pixel when this light casts ray traced shadows. Higher values give smoother soft shadows at a higher cost. |