In this lesson, you will learn how to create and apply Light Function Materials to project dynamic patterns or shadow masks directly from your light sources, allowing you to break up static lighting with stylized silhouettes.
The Core Concept
A Light Function is a special type of Material applied to a light actor (like a Point, Spot, or Directional Light) that acts as a physical "gobo." Instead of calculating surface shading, the Material output acts as a grayscale multiplier for the light's intensity. Where the Material is black, the light is blocked; where it is white, the light passes through.
To set this up, create a new Material and change its Material Domain in the Details panel to Light Function. Unlike standard materials, you only have access to the Emissive Color output.
Creating Dynamic Patterns
To make your light projection dynamic, you can use the Absolute World Position node combined with a Panner or Time node. By plugging a noise texture or a custom gradient into the Emissive input, you can simulate flickering flames, passing clouds, or spinning blades.
Here is a simple example of a scrolling light texture:
// Concept: Multiply a texture by a Panner to create moving shadows
TextureSample(MyNoiseTexture) * Panner(Time, Speed=(0.1, 0.1))
Applying the Effect
Once your Material is compiled, select your light source in the viewport. Look for the Light Function category in the Details panel and assign your Material to the Light Function Material slot. You can then adjust the Light Function Scale to size the projection correctly.
Because these functions calculate in real-time, they are excellent for environmental storytelling—like a flickering neon sign or light filtering through swaying tree branches. However, keep in mind that these functions are applied per-pixel; while they are less expensive than shadow-casting geometry, complex math within the Material graph can still impact your frame budget. Always use textures with lower resolutions if the pattern is meant to be blurry or subtle.
Key Takeaway: Light Function Materials serve as dynamic "gobo" masks that multiply light intensity based on your graph, allowing you to add complex atmospheric motion and depth to your lighting without adding extra geometry.