Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Bloom pyramid implementation. The renderer is supplied to render(); the chain owns its mip-level render targets and three shader materials.

    Index
    levels: number
    threshold: number
    smoothing: number
    radius: number
    mips: MipLevel[] = []
    thresholdMat: Material
    downsampleMat: Material
    upsampleMat: Material
    thresholdUniforms: {
        uInput: IUniform<Texture<unknown, TextureEventMap> | null>;
        uTexelSize: IUniform<Vector2>;
        uThreshold: IUniform<number>;
        uSmoothing: IUniform<number>;
    }
    downsampleUniforms: {
        uInput: IUniform<Texture<unknown, TextureEventMap> | null>;
        uTexelSize: IUniform<Vector2>;
    }
    upsampleUniforms: {
        uInput: IUniform<Texture<unknown, TextureEventMap> | null>;
        uTexelSize: IUniform<Vector2>;
        uRadius: IUniform<number>;
    }
    • Change the number of mip levels and rebuild the pyramid.

      If canvasSize is omitted the new pyramid is rebuilt at the SAME canvas size implied by the existing mip[0] (×2 because mip[0] is half-res). Callers that have just resized the canvas MUST pass the new size explicitly to avoid a stale-mip race.

      Parameters

      • levels: number
      • OptionalcanvasSize: { width: number; height: number }

      Returns void

    • Allocate the mip pyramid for a canvas of the given size.

      this.levels is the user-requested ceiling, but levels are also capped on physical size: a mip whose dimension would drop below MIN_MIP_DIM is skipped, because at 1×1 / 2×1 / 3×2 the per-pass overhead (FBO bind, viewport setup, tile setup on TBDR GPUs) dwarfs the actual texture work and adds visible cost without any visual contribution. The first mip is always allocated so the bloom output texture exists even at very low resolutions.

      Parameters

      • canvasWidth: number
      • canvasHeight: number

      Returns void