Small World Engine API Reference - v0.76.20
    Preparing search index...

    Class AOPassGL

    Generates the HBAO texture for WebGL2 -- reconstructs view-space position/normal from the already-captured opaque depth buffer and estimates per-direction horizon angles, in a single full-resolution pass (no separate blur/denoise pass; see AO.frag.glsl for the trade-off). WebGL1 has no sampleable depth texture to reconstruct from, so this is WebGL2-only.

    Index
    • Renders the HBAO texture from the opaque depth buffer.

      Parameters

      • depthTexture: WebGLTexture

        The already-captured opaque (pre-transparent) depth texture.

      • width: number

        Canvas width in pixels.

      • height: number

        Canvas height in pixels.

      • near: number

        Camera near plane.

      • far: number

        Camera far plane.

      • projMatrixData: Float32Array

        The camera's raw perspective projection matrix.

      • hbao: HbaoElement

        The HBAO effect parameters (radius, intensity).

      Returns WebGLTexture | null

      The single-channel AO texture (R = occlusion factor, 1.0 = fully lit), or null if unavailable.