Tutorial #2: Immersive Lighting "Surround Lighting"
In this tutorial, you'll learn the basics of the core Immersive Lighting ("Surround Lighting") tech, its various features and settings as well as how to get it implemented and optimized in your levels. By the end of this tutorial you'll have a great understanding of how to take your content to the next level.
#1: Create an Immersive Lighting Layout
The first step we'll need to do if you haven't done so already, is to setup your Immersive Lighting Layout that contains all of the relative light positions in real-world space. Add a new UltraStorm->Immersive Lighting Layout asset under the Content Browser.
Edit the new asset after its been created and add new lights to the Lighting Setup while making sure to enter in their names properly (to see all names, add an Immersive Light to your scene and select Display All Light Names). Next, we'll need to go ahead and enter in the dimensions of the space and each lights relative real-world position.
For example, in our case, we decided our origin would reside at the center of our display which is where the user's head would be positioned. We then measured out using X (forward/backward), Y (left/right), and Z (up/down) for each light in cm from our monitor's center position.
You can also set a Test Color for each light which is used with Immersive Lights and Immersive Lighting Probes to visually make out where each light resides in a location.
NOTE: In an upcoming release, you'll be able to use the Immersive Lighting application on desktop and mobile to configure your assets in the editor. This will result in a much quicker setup instead of having to manually enter in the measurements for each individual light.
We will also be extending this support in our upcoming pro tools for virtual production to add greater control and flexibility to easily customize the lights during a production. Another thing to keep in mind is we will be adding other ways to setup and/or track the lights to automate this even further.
In-game, the data will be sent directly across the desktop/mobile app to sync up with the instance.
Finally, you'll need to set your default layout for the Immersive Lighting system. At this time, changing this requires a restart of the editor but this will be more streamlined in the future.
#2: Add ImmersiveLightingProbe(s) to your level
The Immersive Lighting Probe actor gathers the in-engine lights that are used by the Immersive Lighting System. It can be configured to automatically gather the nearby surrounding lights or allow the user to specify which ones it uses manually. You can also specify if you want to exclude specific lights.
Adjust the Light Radius to surround a group of lights in the level or make it Unbound to gather all lights.
OPTIMIZATION TIP: At this time, if you have a level with light sources scattered across it, it's best to create multiple probes to group the lights in a given radius. You can also cull out lights by setting the valid ones in a group manually.
#3: Configure the IL Probe(s) Settings
Override Lights: Sets the default light Actors that will manually be set
Override Light Actors: Sets the Actors that contain ULightComponents that will be manually set
White Lights: The lights used that can emit white light (DMX feature)
Amber Lights: The lights used that can emit amber light (DMX feature)
UV Lights: The lights used that can emit UV light (DMX feature)
Light Radius: The radius (or distance) from the probe where lights will be gathered
Probe Radius: The radius (or distance) from the probe where light samples will be valid
Blend Factor: Scales the final result of this Immersive Lighting Probe
Light Intensity: The overall intensity of the non-directional lights sampled by this probe if Override Light Intensity is enabled
Directional Light Intensity: The overall intensity of the directional lights sampled by this probe if Override Light Intensity is enabled
Set Lights Manually: Whether or not to set the lights manually
Override Light Intensity: Whether or not to override the overall intensity of the lights sampled by this probe
Unbound: Whether or not this probe ignores its radius and gathers all lights
#4: Setup an Immersive Lighting Origin
The next step will be to either add an Immersive Lighting Origin actor to the level or you can add an Immersive Lighting Origin Component to your pawn or camera to update the players POV. Once you've done that, set Update Every Frame to true if you want the origin to update each frame. Is Default Origin is also true since this is the primary origin we'll be using to drive the system.
#5: Start/Stop Immersive Lighting
Following setting up the origin and probes in your level, we need to call Start Immersive Lighting and Stop Immersive Lighting to set when it is running. You can add the custom ImmersiveLighting.umap that is found in the Immersive Lighting Plugins Content Folder under Maps or you can trigger it yourself. Below is an example of how it is setup in that custom level to be triggered on BeginPlay and EndPlay.
Configure Immersive Lighting (optional)
That's it! Now that everything is setup to test out, let's take a look at the settings for Immersive Lighting and review what each does. The settings can be found under Project Settings -> Plugins -> Immersive Lighting.
Default Layout: The default layout used for the Immersive Lighting System
Sample Method(s): The sampling method(s) used for the Immersive Lighting System (Dynamic Sampling and/or Precomputed Volumes)
- Dynamic Sampling: Dynamically samples the lighting using the Immersive Lighting System
- Precomputed Volumes: Uses the built in pre-computed lighting volumes (requires Sparse Volume Lighting Samples in Lightmass)
Post Probe Sampling: The color operation to apply after sampling multiple lights used by an Immersive Lighting Probe
Post System Sampling: The color operation to apply after sampling multiple lights used by the Immersive Lighting System
Lighting Influence Method: The default lighting influence method used for the Immersive Lighting System
- Custom: Custom attenuation determined by Near/Far Attenuation Factors
- Linear: Linear attenuation
- Distance: More responsive distance factor and not as strong of a falloff as ISL
- Inverse Square Law: Uses ISL to calculate lighting samples if the light supports it
Lighting Collision Handling: The default lighting collision handling method used for the Immersive Lighting System
- None: Updates the world-space location of each light controller to be exactly where it should. The controllers don't respect collision and can end up in walls if you're not careful.
- Normal: If a controller is inside a primitive, it won't register as a valid collision.
- Scaled: This will project the positions of each controller outward until it collides with another primitive within a specified max scale.
Light Intensity Units: The light units to use when scaling the intensity if Apply Intensity Sampling is enabled.
Default Light Color: This is the default light color to use when resetting all of the light controllers used by the Immersive Lighting System.
Brightness Intensity: The overall lighting brightness intensity used for the Immersive Lighting System
Non-Directional Light Contribution: The overall intensity of the non-directional lights sampled by the Immersive Lighting System
Directional Light Contribution: The overall intensity of the directional lights sampled by the Immersive Lighting System
Max Light Intensity: The maximum ULightComponent light intensity (in Candelas) to use when sampling the lighting excluding directional light sources NOTE: If this is not greater than 0, the light intensity will not be taken into account
Max Directional Light Intensity: The maximum ULightComponent light intensity (in Lux) to use when sampling the lighting from only directional light sources NOTE: If this is not greater than 0, the max light intensity used will be PI
Light Controller Location Scale: The amount to scale the position of the light controller(s) inward or outward by
Light Controller Radius: The radius of the light controller(s) used for collision testing
Distance Falloff Factor: The factor to use to scale the distance (usually from cm to m) if calculating either the Distance or Inverse Square falloff for a light source.
Distance Cutoff: Sets how many Unreal Units (cm) are required to have the light at full strength before it starts falling off
Near Attenuation Factor: Sets the near attenuation curve factor. NOTE: Custom attenuation must be enabled
Far Attenuation Factor: Sets the far attenuation curve factor. NOTE: Custom attenuation must be enabled
Directional Light Trace Distance: The trace distance used for directional lights for collision detection by the Immersive Lighting System if 'Occlusion Detection' is set to true
Collision Trace Distance: The trace distance used for all other lights for collision detection by the Immersive Lighting System if 'Occlusion Detection' is set to true
Interpolation Speed: If > 0, this will interpolate colors between light color transitions at a set speed when sampling lighting for the Immersive Lighting System
Update Rate: The rate (in fps) at which to update the Immersive Lighting System
Consistent Brightness: Whether or not the light brightness stays at a consistent intensity. NOTE: This is in case the user wants to not have the light brightness levels also dynamically change around them
Occlusion Detection: Whether or not occlusion testing is being used for sampling lights used the Immersive Lighting System
Occlusion Optimization: Whether or not occlusion testing is optimized from the origin instead of the each virtual light source location. NOTE: This only affects occlusion detection if GPU Compute is used and is not currently enabled for CPU processing
Full Dynamic Sampling: Whether or not Dynamic Sampling if enabled, samples from all available lights or only dynamic (moveable) lights for the Immersive Lighting System
Clamp Intensity Sampling: Whether or not to clamp the light intensity used in sampling using the 'Max Light Intensity' and 'Max Directional Light Intensity' settings if they are set. You might choose to normalize the output and disabled this setting for a more accurate color
Apply Light Intensity: Whether or not to to factor in the brightness of a ULightComponent when sampling the in-game lights. Use 'Light Intensity Scale' to adjust the intensity of the lights so that they aren't blown out for exceeding 1
Reset Lights On Boot Up: Whether or not to reset the lights to their default color upon starting up either in the game or the editor.
Reset Lights On Stop IL (Editor): Whether or not to reset the lights to their default color upon calling 'Stop Immersive Lighting' when running in the editor.
Reset Lights On Stop IL (Game): Whether or not to reset the lights to their default color upon calling 'Stop Immersive Lighting' if running the game.
Is Enabled: Whether or not the Immersive Lighting functionality is enabled. NOTE: The Immersive Lighting functionality can be enabled or disabled during real-time but this controls if is globally active