API ReferenceGE ExtensionsClient
PostFx Fog Effects
Atmospheric fog and underwater fog post-processing effects. Creates two independent PostEffect chains for above-water and underwater fog rendering.
Atmospheric fog and underwater fog post-processing effects. Creates two independent PostEffect chains for above-water and underwater fog rendering.
Overview
Declarative setup script (no M module). Registers two fog systems:
Atmospheric Fog
FogPassShader- ShaderData sampling the prepass textureFogPassStateBlock- Alpha-blended state block (SrcAlpha / InvSrcAlpha)FogPostFx- PostEffect (enabled by default, priority 5, renders before translucent bin)
Underwater Fog
UnderwaterFogPassShader- Underwater fog pixel shaderUnderwaterFogPassStateBlock- Clamp-point sampler statesUnderwaterFogPostFx- One-frame PostEffect (enabled, priority 4, renders before translucent bin)UnderwaterFogPostFxCallbacks- Enables/disablesCausticsPFXin sync
Scene Objects
| Object | Type | Default Enabled | Priority | Description |
|---|---|---|---|---|
FogPostFx | PostEffect | true | 5 | Atmospheric distance fog |
UnderwaterFogPostFx | PostEffect | true | 4 | Underwater fog with depth gradient |
Global Callbacks
| Global | Callback | Description |
|---|---|---|
UnderwaterFogPostFxCallbacks | onEnabled() | Enables CausticsPFX when underwater fog activates |
UnderwaterFogPostFxCallbacks | onDisabled() | Disables CausticsPFX when underwater fog deactivates |
Texture Inputs
-- Atmospheric fog reads:
fogPostFx:setField("texture", 0, "#prepass[RT0]")
fogPostFx:setField("texture", 1, "#prepass[Depth]")
-- Underwater fog reads:
underwaterFogPostFx:setField("texture", 0, "#prepass[RT0]")
underwaterFogPostFx:setField("texture", 1, "#prepass[Depth]")
underwaterFogPostFx:setField("texture", 2, "$backBuffer")
underwaterFogPostFx:setField("texture", 3, "#waterDepthGradMap")Notes
- Underwater fog uses
oneFrameOnly = true- it only renders when explicitly triggered per frame - Both effects render in
PFXBeforeBinatObjTranslucentBin - Atmospheric fog uses alpha blending for smooth distance falloff
- CausticsPFX is automatically toggled with the underwater fog effect
See Also
- PostFx Flash - Screen flash effect
- PostFx Light Ray - Volumetric light rays
PostFx Flash Effect
Screen flash post-processing effect for damage and whiteout visual feedback. Creates a `FlashFx` PostEffect driven by shader constants for damage flash intensity and whiteout amount.
PostFx FXAA Anti-Aliasing
NVIDIA FXAA 3.11 (Fast Approximate Anti-Aliasing) post-processing effect by Timothy Lottes. Provides edge-smoothing as an alternative to SMAA.