Limen Framework 0.1 Help

ULimenScreenVisibilityChecker

Overview

ULimenScreenVisibilityChecker is a custom UActorComponent designed to determine if an actor is visible on the screen. It uses a render target, scene capture, and a compute shader to perform this check. The component can be spawned in Blueprints and provides events for visibility updates.

Properties

Type

Name

Access

Description

TSoftObjectPtr<UTextureRenderTarget2D>

DebugVisualizationRenderTarget

Protected

A soft pointer to a debug visualization render target. Only available in editor mode.

float

RenderTargetSizeScale

EditDefaultsOnly

The scale factor for the render target size relative to the viewport. Default is 0.5.

TSoftObjectPtr<UMaterialInterface>

StencilCheckerMaterial

EditDefaultsOnly

A soft pointer to the material used for stencil checking.

FName

MaskParameter

EditDefaultsOnly

The name of the parameter in the stencil checker material that defines the mask to check. Default is "Mask".

int32

MaskToCheck

EditDefaultsOnly

The value of the mask to check against. Default is 1.

Functions

Return Type

Signature

Description

FVisibilityUpdate

OnActorVisibilityUpdated

A multicast delegate that fires when the actor's visibility changes.

int32

GetStencilMask() const

Returns the current mask value being checked.

bool

IsVisible() const

Returns whether the actor is currently visible on the screen.

UTextureRenderTarget2D*

GetRenderTarget() const

Returns the render target used for capturing the scene.

Usage & Implementation Notes

  • Threading Constraints: The component uses asynchronous tasks to handle GPU readback, ensuring that it does not block the game thread.

  • Replication Requirements: This component is designed to be used in a single-player or local environment and does not require replication.

  • Memory Lifetime Management: The render target, scene capture, and material instances are managed using strong and weak pointers to ensure proper memory management.

  • Initialization Dependencies: The component requires an owner camera to function correctly. It attempts to find the camera from the owning pawn or the root component of the actor.

22 May 2026