API ReferenceGE ExtensionsClient
PostFx SSAO (Screen-Space Ambient Occlusion)
Dual-radius screen-space ambient occlusion effect. Provides small-radius detail occlusion and large-radius contact shadows with configurable quality levels.
Dual-radius screen-space ambient occlusion effect. Provides small-radius detail occlusion and large-radius contact shadows with configurable quality levels.
Overview
Declarative setup script (no M module). Registers:
SSAOPostFx- Main SSAO PostEffect (PostEffectSSAOclass)SSAOVizPostFx- Debug visualization of the SSAO maskSSAOPowTableShader/SSAOPowTablePostFx- Power table lookup textureSSAOPostFxCallbacks- Enables/disables AL SSAO mask, manages quality and shader constants
Scene Objects
| Object | Type | Description |
|---|---|---|
SSAOPostFx | PostEffectSSAO | Main SSAO compute pass |
SSAOVizPostFx | PostEffectSSAO | Debug: renders #ssaoMask to back buffer |
SSAOPowTablePostFx | PostEffect | Generates #ssao_pow_table (256×1, R16F, on-demand) |
Global Callbacks
| Global | Callback | Description |
|---|---|---|
SSAOPostFxCallbacks | onEnabled() | Sets $AL::UseSSAOMask = true |
SSAOPostFxCallbacks | onDisabled() | Sets $AL::UseSSAOMask = false |
SSAOPostFxCallbacks | onAdd() | Initializes tracking state |
SSAOPostFxCallbacks | preProcess() | Updates quality macro (0/1/2) and target scale |
SSAOPostFxCallbacks | setShaderConsts() | Pushes all SSAO parameters to shader uniforms |
Console Variables
Global
| Variable | Default | Description |
|---|---|---|
$SSAOPostFx::overallStrength | 2.0 | Master intensity multiplier |
$SSAOPostFx::quality | 0 | Quality level (0, 1, or 2) |
$SSAOPostFx::targetScale | "0.5 0.5" | Render target resolution scale |
$SSAOPostFx::blurDepthTol | 0.001 | Blur depth tolerance |
$SSAOPostFx::blurNormalTol | 0.95 | Blur normal tolerance |
Small Radius (s-prefix)
| Variable | Default | Description |
|---|---|---|
$SSAOPostFx::sRadius | 0.1 | Sample radius |
$SSAOPostFx::sStrength | 6.0 | Occlusion strength |
$SSAOPostFx::sDepthMin | 0.1 | Minimum depth |
$SSAOPostFx::sDepthMax | 1.0 | Maximum depth |
$SSAOPostFx::sDepthPow | 1.0 | Depth power curve |
$SSAOPostFx::sNormalTol | 0.0 | Normal tolerance |
$SSAOPostFx::sNormalPow | 1.0 | Normal power curve |
Large Radius (l-prefix)
| Variable | Default | Description |
|---|---|---|
$SSAOPostFx::lRadius | 1.0 | Sample radius |
$SSAOPostFx::lStrength | 10.0 | Occlusion strength |
$SSAOPostFx::lDepthMin | 0.2 | Minimum depth |
$SSAOPostFx::lDepthMax | 2.0 | Maximum depth |
$SSAOPostFx::lDepthPow | 0.2 | Depth power curve |
$SSAOPostFx::lNormalTol | -0.5 | Normal tolerance |
$SSAOPostFx::lNormalPow | 2.0 | Normal power curve |
Usage Example
-- Enable SSAO
local ssao = scenetree.findObject("SSAOPostFx")
if ssao then ssao:enable() end
-- Increase quality
TorqueScriptLua.setVar("$SSAOPostFx::quality", "2")
TorqueScriptLua.setVar("$SSAOPostFx::overallStrength", "3.0")
-- Debug visualization
local viz = scenetree.findObject("SSAOVizPostFx")
if viz then viz:enable() endNotes
- Defaults are only set on first load (not on Lua reload) to preserve runtime changes
- The
#ssaoMaskrender target is consumed by the Advanced Lighting (AL) shaders - Blur passes exist but their integration is marked as TODO in comments
- Quality macro
QUALITYcontrols sample count in the shader (0=low, 1=med, 2=high)
See Also
- PostFx Light Ray - Volumetric light rays
- Render Manager - AL format token setup
PostFx SMAA Anti-Aliasing
Enhanced Subpixel Morphological Anti-Aliasing (SMAA) post-processing effect. Three-pass pipeline: edge detection, blending weight calculation, and neighborhood blending.
PostFx Turbulence Effect
Screen-space turbulence distortion post-processing effect. Applies a heat-haze or ripple distortion to the back buffer.