Light Function in Unreal: Paint Light and Shadow
Shape where sunlight and spot light land by painting shadow, instead of building blocker meshes.
To paint light and shadow in Unreal, put a grayscale mask on a light as a light function. Plain Unreal needs a light function material, usually with a mask texture. Shadow Painter, in the paid CG Foundry Lighting Suite, lets you brush that mask in the viewport on Spot and Directional Lights.
What you get
You decide where the light lands. Add broken shade across a sunlit floor. Hold light on the spot where a character stands while the wall around it falls away. Fade a Spot Light out across a wall.
The result stays part of the light you already have. There is no new light to balance and no blocker mesh to move, scale or explain to your team later.
Set up a light function in Unreal
- Create a material and set its Material Domain to Light Function.
- Connect a grayscale mask to Emissive Color. Bright areas let light through and dark areas block it.
- Select a light that is Movable or Stationary.
- In the Details panel, assign your material to Light Function Material.
- Light Function Scale starts at
1024on each axis. On a Directional Light it sets the pattern size: at the default, one tile covers about 10 m. On a Spot Light the pattern is fitted to the cone, so changing all three values together does nothing. Raise X and Y while Z stays the same to enlarge it, or tile the mask inside the material. - If the pattern fades far away, raise Fade Distance. It starts at
100000(about 1 km), where the light moves to Disabled Brightness (0.5).
Directional, Point, Spot and Rect Lights support light functions; Sky Lights do not. A light function is never baked into lightmaps, and Cast Shadows does not need to be on.
The slow part is the mask itself. You paint a texture in another application, import it and check the viewport. Then you go back, again and again, until the shadow sits in the right place.
Paint it in the viewport with the Lighting Suite
The Lighting Suite details in this guide describe version 1.0.3 on Unreal Engine 5.8.
Shadow Painter, one of the tools in the Lighting Suite, turns that loop into brush strokes on the scene. You get 9 painting tools and 4 brush textures: Clouds, Foliage, Noise and Streak. The paint is a grayscale texture that Unreal projects through your own Spot Light or Directional Light as a light function. You do not build a material first.
A typical pass looks like this:
- Choose the light that owns the shade. Use the sun for large shapes across an exterior. Use a Spot Light for local control on a wall, a prop or a character.
- Start from full light and paint shadow where the eye should not go. Or start from full shadow and paint light back onto the subject.
- Shape the edges. Build long falloffs, break up a surface like light through leaves, soften hard edges or push paint along a stroke.
- Adjust without repainting. Change how the light shows the paint while the saved paint stays as it was.
- Keep it. The paint is saved as its own asset, can be reused as a preset, and also renders in packaged games.
With a Directional Light, the paint covers an area of your level. By default it moves when you rotate the sun, and you can switch that off to keep it fixed. The paint belongs to the light, so it does not follow a character on its own.
Need a ready made window frame, blinds or leaf pattern? Gobos in the Lighting Suite use the same light function system. Painted shade can mask a gobo or replace it. The Shadow Painter documentation covers every control.
Limits and costs to check first
Painted light is still a light function, so Unreal's rules apply. Check these before you build a shot around it.
GPU cost. Epic notes that light functions use the same expensive passes as lights with dynamic shadows. Unreal's Light Function Atlas can lower that cost for some materials, but not for painted lights. Measure on your target hardware with stat gpu.
Low shadow quality. At the Low Shadow Quality level, r.LightFunctionQuality is 0. No light function or paint shows, in packaged games too.
MegaLights. MegaLights supports light functions only through the atlas. In a project that uses MegaLights, a painted Spot Light shows no paint while Allow MegaLights is on for that light. The tool reports this and offers to turn the option off for those lights. Without MegaLights the light renders as a regular light, which adds GPU cost, so check stat gpu afterwards.
Volumetric Fog. Spot Light paint does not appear in the fog, because the fog reads local light patterns only from the Light Function Atlas. To shape a Spot Light beam, use a gobo without paint. Painted sunlight is drawn into the fog. Fine detail can look softer there, because it follows the fog's resolution.
Light types. Shadow Painter works on Spot and Directional Lights that are Movable or Stationary. For Point and Rect Lights, use a gobo.
One light, not one object. Everything the light reaches at a painted spot changes. To treat one object differently, move it to another Lighting Channel and light it separately. Channels mainly control direct light on opaque materials.
Two sun settings change. In Lighting Suite 1.0.3, painting a Directional Light raises Fade Distance in its Light Function settings and sets Disabled Brightness to 1. That keeps the paint from fading with distance. Undo reverts both.
Large levels. In Lighting Suite 1.0.3, a Directional Light spreads one texture across a wide area, so detail per meter drops as the level grows. The documentation gives about 2 m per pixel at 1024 resolution on a 2 km level. Raise the resolution when you need finer shapes.
Engine support. Lighting Suite 1.0.3 runs on Unreal Engine 5.8 on 64-bit Windows. Source-built engines need a Source License.
Check your result
Judge the painted version against the unpainted one at the same exposure. If auto exposure is active, the camera can brighten the whole image after you add shade and hide what you actually changed.
Move the camera through the gameplay path or the shot. A shadow that looks designed from one angle can read as a dirty patch from another. Then look at indirect light. Lumen includes light functions when it works out bounce light, so a large painted shadow on the sun can darken nearby bounce too.
If you want to try it on your own scene, the Lighting Suite free trial opens every tool for 7 days with no card. The trial is for evaluation, not client work.
Full access for 7 days. No card needed.
Try the Lighting Suite free for 7 daysFAQ
Can I paint on Point or Rect Lights?
Shadow Painter works on Spot and Directional Lights only. To shape a Point or Rect Light, use a gobo, which projects a texture through the light with the same light function system.
How do I paint foliage shadows in UE5?
For the look of light through leaves, use a leaf pattern in a light function. Or brush it in Shadow Painter with the foliage or noise textures. For shadows that match real plants and move with them, use foliage meshes that cast shadows.
Do light functions need the Lighting Suite?
No. Light functions are built into Unreal and work with your own material. The Lighting Suite adds brush painting in the viewport for Spot and Directional Lights.
Do painted shadows work with MegaLights?
In a project that uses MegaLights, a painted Spot Light does not show its paint while Allow MegaLights is on, because MegaLights only supports light functions through the Light Function Atlas. Turn that option off on the painted light, then check the GPU cost. Painted sunlight still shows by default, because MegaLights leaves Directional Lights out.
Related guides

LightingIntermediate
How to Fix Texture Streaming Pool Over Budget
What the red message means, how to find the textures behind it, and when a bigger pool is the right answer.
8 min readVideo

Career and PortfolioBeginner
Game Art Portfolio: What Studios Ask to See
What three lighting and level art job ads ask to see, published reviewer advice, and a plan for your next piece.
10 min read