By default, all indirect light that strikes a surface is reflected. For each material, you can specify the fraction of indirect light that passes through.
By default, the precompute treats the of meshes as invalid. To avoid unnecessary computation, radiosity isn't computed for surfaces that see invalid backfaces; these surfaces have invalid indirect lighting. When a mesh is excluded from the radiosity computation, the backfaces of adjacent meshes can be exposed. To prevent invalid lighting, check for invalid backfaces visible through holes that may have been introduced when a mesh was excluded.
To prevent problems caused by invalid backfaces, you can specify how Enlighten treats the backfaces of such meshes. For thin opaque objects such as sheets of metal, you can have Enlighten treat the backface as opaque. For objects that simulate cloth, such as curtains or flags, you can make both front and backfaces transmit part of the incoming light.
With Enlighten, the color of light reflected by a surface depends on its albedo (also known as base color). The color and amount of light emitted by a surface depends on its emissive color and intensity. You can change the albedo and emissive colors in-game using Blueprints.
Backface type and indirect opacity
You can control how surfaces interact with indirect light with the following material properties. Backface Type determines the way Enlighten interprets the backfaces of these surfaces. Indirect Opacity determines how much indirect light is reflected by the surface; the rest passes through.
Your changes to these properties don't take effect until you run the precompute.
When Backface Type is Automatic, the backface type is determined automatically based on the material's Blend Mode and Two Sided properties.
The other values cause Enlighten to interpret backfaces as follows:
- Invalid: indirect lighting is invalidated for any surface that can "see" the backface. Automatically chosen if the material is opaque.
- Black: the backface absorbs all incoming indirect light. Automatically chosen if the material is two-sided and opaque.
- Transparent: the backface is transparent to incoming indirect light. Automatically chosen if the material is not opaque.
- Double Sided: both the frontface and backface diffusely transmit 50% of incoming indirect light, and diffusely reflect 50% of incoming indirect light. Automatically chosen if the material is two-sided and not opaque.
Indirect Opacity is ignored if Backface Type is Invalid or Black. Otherwise, the value of Indirect Opacity controls the amount of indirect light reflected by a surface using the material. A value of zero means all indirect light passes through the surface.
Albedo and emissive colors
By default, Enlighten automatically determines the surface albedo and emissive color at a given point on the surface by evaluating the material's base color and emissive outputs. This is known as static albedo/emissive because it works with material outputs that don't change in the game. There's no effect on indirect lighting when the color of a material using static albedo/emissive changes in game mode.
You can set albedo and emissive properties independently. For example, a material can use static albedo and dynamic emissive at the same time.
You can also override these properties for a material instance in the Material Instance Editor.
Control static albedo and emissive
To boost the intensity of light reflected by a material, in the Material Editor, set the Static Albedo Boost factor.
This is applied to to the static albedo color that was sampled from the material. The result can never be brighter than 100% white.
By default, materials don't emit light, even when they have emissive outputs. To make the material emit light, enable Use Static Enlighten Emissive.
The Static Emissive Boost factor is applied to the emissive color when Use Static Enlighten Emissive is enabled.
Animate albedo and emissive in game
To make a simple material with an animated Emissive Color that affects Enlighten lighting, follow these steps:
- Enable Use Dynamic Enlighten Emissive for the material and set the Dynamic Enlighten Emissive property to the initial emissive color.
- In the material graph, add a vector parameter named EmissiveColor and connect it to the Emissive Color output.
- Apply the material to a Static Mesh Component that is part of a Blueprint actor placed somewhere in the world.
- Run the Enlighten Precompute to enable Enlighten lighting for the actor.
- In the Blueprint construction script call CreateDynamicMaterialInstance on the Static Mesh Component, specify your material as the Source Material and store the output in a variable with type Material Instance Dynamic.
- In the Blueprint, add a function named Set Dynamic Emissive which does both SetDynamicEnlightenEmissive and sets the EmissiveColor parameter on the Dynamic Material Instance at the same time
Optionally, in the Blueprint construction script, set the initial emissive color using the Set Dynamic Emissive function you just created.
- When you want to change the emissive color, call the Set Dynamic Emissive function.
To make a material with an animated albedo color that affects Enlighten lighting, follow the same steps as above, except:
- Enable Use Dynamic Enlighten Albedo for the material.
- Set the Dynamic Enlighten Albedo property to the initial emissive color.
- In the material graph, add a vector parameter named AlbedoColor and connect it to the Base Color output.
- In the Blueprint, call SetDynamicEnlightenAlbedo and set the AlbedoColor parameter on the Dynamic Material Instance at the same time.
Changes to the Use Dynamic Enlighten Albedo and Use Dynamic Enlighten Emissive properties of the material applied to an actor don't take effect until you run the Enlighten Precompute.
Disable automatic static albedo updates
By default, static albedo/emissive is updated automatically when you make changes in the editor. To work around rare cases where the update of static albedo/emissive takes too long, you can disable automatic updates using Edit > Editor Preferences > Plugins > Enlighten > Disable Automatic Enlighten Static Albedo Updates. When
- play the level
- save a sublevel
- run the precompute
- click Build > Update Enlighten Static Albedo
When automatic updates are disabled, static albedo and emissive aren't updated when materials are modified, which can produce incorrect lighting. We recommend leaving automatic updates enabled.