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

    Class AbstractWebGLRendererAbstract

    Base class for all renderer implementations.

    Backends are expected to implement defensive rendering strategies to prevent "silent failures":

    1. Validate that all uniforms defined in a material's layout are actually present in the compiled shader.
    2. Log warnings or errors if expected data structures (e.g., WebGPU uniform blocks) are missing or misaligned.
    3. Provide fallback values or behaviors if specific features (like rounded rects) are not supported by the hardware.

    Hierarchy (View Summary)

    Index
    _clearColor: Color = ...

    The clear color of the renderer.

    _frameFar: number = 1000
    _frameNear: number = 0.1

    This frame's camera near/far and raw projection matrix, stashed here so flushPostProcess() (called later, from a pass with no camera parameters of its own) can hand them to HBAO for reconstructing view-space position from the opaque depth buffer. _frameProjMatrix is also handed to WebGLRenderPass.execute() as an explicit parameter every frame (see below) for WebGLClusterCullPass, rather than being a public field passes reach for directly.

    _frameProjMatrix: Float32Array<ArrayBufferLike> | undefined = undefined
    _lightData: LightDataInterface = ...

    Cached light data to avoid GC pressure.

    _passes: WebGLRenderPass[] = []
    _quality: QualityConfig = ...

    Global quality settings.

    defaultCubeTexture: WebGLTexture
    defaultNormalMap: WebGLTexture
    defaultSpecularMap: WebGLTexture
    defaultTexture: WebGLTexture
    gl: WebGLRenderingContext | WebGL2RenderingContext
    postProcessing: PostProcessingGroup = ...

    The global post processing volume/group.

    The type of the renderer.

    • Captures the opaque depth buffer into a sampleable texture for underwater/refraction effects. No-op on renderers without a compatible depth-capture path (see WebGL1Renderer).

      Returns void

    • Releases the GPU geometry buffer, compiled program, and textures this object was referencing, for whichever of those its refCount drops to zero. Called once per removed object per frame; implemented per-renderer since these caches are renderer-specific (each renderer has its own GL context).

      Parameters

      Returns void

    • Renders a scene.

      Parameters

      • scene: Scene
      • vp: Float32Array
      • camPos: Vector3D = Vector3D.ZERO
      • OptionalvMat: Float32Array<ArrayBufferLike>
      • Optionalnear: number
      • Optionalfar: number
      • OptionalprojMatrix: Float32Array<ArrayBufferLike>

      Returns void