Nano WebGPU API - v0.11.0
    Preparing search index...

    Class Renderer

    Renderer coordinates the forward rendering pipeline. It manages core presentation textures (depth attachments, HDR color buffers), aggregates and uploads light properties to storage buffers, compiles global viewport/ambient uniform bind groups, drives instanced drawing via BatchManager, runs directional shadow map passes via ShadowSystem, supports multi-pass overlays (using the .nextPass material feature), and applies fullscreen post-processing FXAA filters.

    Index

    Constructors

    Methods

    • Releases depth targets, color buffers, lights storage buffers, and cascades destruction to subsystems.

      Returns void

    • Computes and submits the complete rendering pass commands for the active frame. Groups meshes into instanced batches, executes shadow passes, resolves global variables, draws PBR base passes, runs secondary overlay passes (outline shaders), and draws fullscreen FXAA quads.

      Parameters

      • scene: Scene

        Source Scene node hierarchy.

      • camera: Camera

        Active viewport camera.

      • perfTracker: PerformanceTracker | null

        Performance statistics recorder.

      • dt: number = 0

        Delta time in seconds since the last frame.

      Returns void

    • Re-allocates presentation targets (depth textures, intermediate color buffers) to match updated canvas sizes.

      Returns void

    • Extracts light properties and updates the GPU storage buffers.

      Parameters

      • lights: readonly Light[]

        Current list of active lights in the scene.

      Returns void

    Properties

    Bloom post-processing system.

    ctx: Context

    Parent context reference.

    elapsedTime: number = 0

    Accumulated rendering time in seconds. Driving shader animations.

    globalsBindGroupDirty: boolean = true

    Flag indicating if global uniform matrices or light properties changed, requiring bind group re-creation.

    renderSettingsBuffer: GPUBuffer

    Uniform buffer containing FXAA configuration flags and accumulated frame time.

    renderSettingsFloat: Float32Array<ArrayBuffer> = ...

    float32 render settings array. [0] = FXAA enable flag, [1] = elapsed seconds, [4..7] = sky color, [8..11] = ground color.

    renderSettingsUint32: Uint32Array<ArrayBuffer> = ...

    uint32 render settings array mapping the float array buffer directly.