Light Functions

Lighting projected using a Material as the source.

Windows
MacOS
Linux

lighting_overview_banner_001.png

Light Functions are, in essence, a Material that can be applied to filter a light's intensity.

It should be noted, however, that you cannot change the color of lights using a Light Function, only the Light Color setting can do that. Also, Static Lights cannot use Light Functions, as this feature is only available for non-lightmapped lights, like Stationary and Movable lights.

In the image below, a Material uses Panner and ScalarParameter nodes to move a texture while generating a flickering effect.

Click image for full size.

Creating a Light Function

You can create a Light Function by setting the Material Domain of a Material to use the Light Function attribute.

MAT_LightFunction.png

Applying a Light Function

You can apply a Light Function to a light from inside the Details panel under the Light Function Material setting.

AddLightFunction.png

Known Issues & Common Questions

The following describes known issues when using Light Functions with the Forward Render.

  • Light Function only works if cast shadows are enabled: This happens because FScene::AssignAvailableShadowMapChannelForLight only assigns a Shadow Map channel to shadow casting lights. Light functions need to be rendered into a Shadow Map to be passed into the base pass in the Forward Render.

  • Light Function only works if there's one shadow casting object: This happens because FDeferredShadingSceneRenderer::RenderForwardShadowProjections skips the light unless VisibleLightInfo.ShadowsToProject.Num() > 0.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback