Skip to content

Sein Fog Of War Render

Class · ASeinFogOfWarRender : AActor

#include "Render/SeinFogOfWarRender.h"

can be subclassed in Blueprint

Draws fog of war over the local player’s view. Place one in the level and assign a Fog Post Process Material; it reads the player’s vision and darkens unexplored and explored-but-hidden areas. It can also switch the view to alternate vision layers, each with its own look.

The vision layer this view shows: -1 for Normal, or 0 to 5 for a custom layer.

int32 GetActiveVisionLayer() const;

Switch the local view to a vision layer: -1 = Normal, 0..5 = custom slot. Rebuilds the fog reveal from that layer’s bit and swaps in its style material. Switching to a disabled / out-of-range custom slot is ignored. Pure render/view change — never touches the sim.

void SetActiveVisionLayer(int32 LayerIndex);

Cycle the local view through Normal → each ENABLED custom layer → Normal.

void CycleVisionLayer();

Force a full rebuild of the tint texture (e.g. after switching the displayed observer in an observer/replay camera). Normally unnecessary — the actor rebuilds automatically when vision changes.

void RefreshFogRender();

TSoftObjectPtr<UMaterialInterface> FogPostProcessMaterial

Editable in defaults and on instances · Blueprint read and write

Post-process material that composites the fog tint over the scene. It reads the texture parameter FogTexture (the per-cell tint, BGRA) and the vector parameters FogWorldMin and FogWorldSize (the world XY rectangle the texture covers). Without it the overlay does nothing and a message is logged. The reference is soft, so placing the actor does not load the material into every map.

FLinearColor UnexploredColor · default FLinearColor::Black

Editable in defaults and on instances · Blueprint read and write

Tint applied to fogged (unexplored + explored-not-visible) cells. Black is the classic RTS look; raise toward a blue/grey for stylized fog.

float UnexploredOpacity · default 1.0f · min 0.0, max 1.0

Editable in defaults and on instances · Blueprint read and write

Opacity over NEVER-explored cells. 1.0 = opaque (can’t see the map at all).

float ExploredOpacity · default 0.75f · min 0.0, max 1.0

Editable in defaults and on instances · Blueprint read and write

Opacity over EXPLORED-but-not-currently-visible cells — the dimmed “terrain memory” tier. The headline tunable: 0 = no dimming, 1 = as dark as unexplored.

float SmoothingStrength · default 0.1f · min 0.0, max 5.0

Editable in defaults and on instances · Blueprint read and write

Edge smoothing as a blur radius in fog cells. 0 gives hard, blocky per-cell edges. Above 0 the fog texture is filtered bilinearly and blurred by that radius, which softens the fog edge and rounds off the stair-stepping. It is cheap because the fog texture is small.

TArray<FSeinVisionLayerView> VisionLayerPostProcessMaterials

Editable in defaults and on instances · Blueprint read and write

Per custom vision layer the player can switch their view to (slot N → layer N0..N5, matching Project Settings > SeinARTS > Vision Layers). When the local player switches to this layer (SetActiveVisionLayer / CycleVisionLayer, or the Sein.Vision.Layer console command), this slot’s Post Process Material is applied FULL-SCREEN on top of the scene but UNDER the base fog — giving that layer its own “visor” look (e.g. a thermal heat palette). The base Fog Post Process Material keeps handling the unexplored/explored darkening, so this material only defines the STYLE, not the fog tint. Leave the material empty for a layer that changes the revealed area without restyling; disable a slot to make it un-switchable.

int32 ActiveVisionLayer · default -1

Read-only in Details

The vision layer the local view is currently using: -1 = Normal (the V bit), 0..5 = the custom layer in slot N. Client-only view state.

TObjectPtr<UPostProcessComponent> PostProcess · default CreateDefaultSubobject<UPostProcessComponent>(TEXT("PostProcess"))

Read-only in Details

Unbound post-process source that carries the style + fog blendables.