Engine Tools

LXR - Light Detection

Explore LXR for Unreal Engine, featuring direct and indirect light detection, silhouette awareness, volume sensing, and full EQS support for AI perception.

LXR - Light DetectionEngine Tools

Resource overview

Direct Light Detection and the LXRFluxComponent Setup

Stealth design and dynamic visual mechanics frequently depend on whether an actor is concealed within shadow or exposed to ambient luminance. Conventional line-of-sight checks fail to address whether an actor is partially illuminated or standing near an active fixture. LXR functions as a lighting detection and perception plugin for Unreal Engine, providing a framework for measuring how much light an actor receives while supplying a broader suite of environmental awareness tools for artificial intelligence.

Implementing direct light evaluation requires pairing two specific elements across your scene. The actor whose illumination needs measuring receives a Detection Component, while any scene actors containing Light Components require Source Components. This configuration enables precise tracking of direct rays between specific fixtures and the evaluated character. In contrast, indirect light detection demands far less preparation. Actors evaluate bounced or ambient illumination simply by attaching an LXRFluxComponent, which operates with no additional scene configuration. The indirect lighting calculation system used by the plugin is open source on GitHub, allowing developers to inspect or integrate the flux calculations into their own rendering workflows.

Light Volume Detection Through the Sense Component

Traditional vision cones force artificial intelligence to look directly at an actor or light source before registering its presence in the environment.

The Sense Component bypasses that limitation by allowing AI actors to perceive and react to light sources strictly through light volumes. Instead of requiring a direct visual trajectory to a mesh or light fixture, the AI detects the volume of illumination cast into the surrounding area. This mechanic proves critical in enclosed spaces, such as an L-shaped corridor where a player character is hidden behind a wall while projecting a flashlight beam onto the floor or opposite surface. The AI identifies the visible light volume spilling around the corner and can respond to the intrusion long before the player steps into direct view.

Evaluating Backlight Contrast with the Silhouette Component

Stealth games often suffer from an oversimplified calculation where standing in darkness confers complete invisibility regardless of the backdrop.

The Silhouette Component resolves this common stealth-game issue by enabling detection of character silhouettes against bright backgrounds. When an actor stands in a dark corridor with a lit doorway or illuminated room positioned directly behind them, raw luminance sensors treat the character as completely hidden because no direct light strikes their mesh. The Silhouette Component shifts the evaluation criteria from absolute light levels to outline visibility, ensuring AI agents recognize when a darkened character is framed against a bright space and react to the contrasting silhouette accordingly.

Tracking State Changes Using the Memory Component

Dynamic stealth environments require non-player characters to understand when the environment has been altered in their absence.

The Memory Component enables AI actors to remember light states even after leaving and returning to a patrol area. When a player turns lights on or off to create cover or navigate a room, AI characters equipped with this component identify the discrepancy upon returning. This state recognition functions through two separate pathways depending on the setup. An agent can detect alterations via the Detection Component if the actor physically enters the altered light volume, or through the Sense Component, where the agent simply needs visual contact with the light volume to notice that the lighting state was modified.

Asynchronous Queries and EQS Support for AI Navigation

Complex environmental queries often require retrieving illumination data at arbitrary spatial points without attaching physical detection components to dummy actors.

LXR integrates full support for Unreal Engine's Environment Query System (EQS), allowing behavior trees to factor lighting values directly into point generation, cover selection, and pathfinding tests. For tasks outside standard EQS runs, the plugin provides the QueryLXRAsyncTask. This asynchronous task lets blueprints and gameplay code query the precise light amount at any coordinate in the game world, making it possible to sample scene illumination on demand without burdening the main gameplay thread. Comprehensive documentation covers standard implementation patterns, backed by direct developer support on Discord for specific integration questions.

Continue Browsing Similar Packs

Free Download

Download this resource

Log in or create a free account to start your download.

Resources are manually reviewed before listing to improve quality and reduce obvious risks.

Resource archiveLXR - Light Detection.7z

Related resources