API

Interface SmaaPostProcessTask

A Subpixel Morphological Anti-Aliasing post-process task.

interface SmaaPostProcessTask {
    alphaMode: PostProcessAlphaMode;
    clear: boolean;
    cornerDetection: boolean;
    diagonalDetection: boolean;
    dominantAxisBlend: boolean;
    edgesTexture: RenderTarget;
    engine: EngineContext;
    executionEnabled?: boolean;
    maxSearchSteps: number;
    minDiagonalRun: number;
    name: string;
    outputTexture: RenderTarget;
    scene?: SceneContext;
    sourceIsSrgb: boolean;
    sourceSamplingMode?: PostProcessSamplingMode;
    sourceTexture: RenderTarget;
    targetTexture: RenderTarget | null;
    threshold: number;
    viewport: NormalizedViewport | null;
    weightsTexture: RenderTarget;
    dispose(): void;
    execute?(): number;
    record(): void;
    updateUniforms(): void;
}

Hierarchy (View Summary)

Index
clear: boolean

Clear the target before drawing. Set false when several viewport passes share a target.

cornerDetection: boolean

Whether axis-aligned corner-pattern attenuation is enabled. Call updateUniforms() after.

diagonalDetection: boolean

Whether 45-degree patterns are detected. Call updateUniforms() after changing it.

dominantAxisBlend: boolean

Whether blending commits to the stronger axis. Call updateUniforms() after changing it.

edgesTexture: RenderTarget

Intermediate edge and weight targets, exposed for debugging the filter.

Engine captured at task creation.

executionEnabled?: boolean

Runtime frame-graph execution gate, default true. When false, the frame graph keeps the task recorded and its resources alive but skips every pass or built-in execute() call for that frame. This is independent from any task-specific enabled state whose disabled transition may still execute work.

maxSearchSteps: number

How far the pattern search runs along an edge, in pixels. Shallow-angle edges make long runs, so raising this can matter on hard-surface content. Call updateUniforms() after.

minDiagonalRun: number

Shortest diagonal run that counts as a 45-degree pattern. Call updateUniforms() after.

name: string
outputTexture: RenderTarget
scene?: SceneContext

Owning scene for scene-bound tasks. Undefined for scene-less standalone frame graphs.

sourceIsSrgb: boolean

Whether the source texture is an sRGB view. Call updateUniforms() after changing it.

sourceSamplingMode?: PostProcessSamplingMode
sourceTexture: RenderTarget
targetTexture: RenderTarget | null

These four are narrowed to non-optional (as PostProcessTask does) because record() forwards them to the presenting pass every frame, so mutating them genuinely takes effect.

threshold: number

Luma difference that counts as an edge. Call updateUniforms() after changing it.

viewport: NormalizedViewport | null
weightsTexture: RenderTarget
  • Re-upload the pass uniforms. Required after mutating any of threshold, maxSearchSteps, diagonalDetection, minDiagonalRun, cornerDetection, sourceIsSrgb or dominantAxisBlend.

    Returns void