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

    What downstream code needs to know about the underlying graphics stack. All static fields are captured once at construction.

    interface RendererCapabilities {
        apiSurface: "webgpu" | "webgl2";
        nativeWebGPUBackend: boolean;
        framebufferYDown: boolean;
        readbackYDown: boolean;
        hdr: HDRCapabilities;
        hdrOutput?: HdrOutputState;
        maxMSAASamples: number;
        maxTextureSize: number;
        maxRenderbufferSize: number;
        pointSizeRange: readonly [number, number];
    }
    Index
    apiSurface: "webgpu" | "webgl2"

    The renderer API surface in use — discriminator for callers that must branch on method signatures (readback shapes, render target wiring, etc.).

    • 'webgl2' → active renderer is THREE.WebGLRenderer.
    • 'webgpu' → active renderer is WebGPURenderer, even when WebGPURenderer's internal backend has fallen back to WebGL2. The callable surface still follows the WebGPURenderer API (e.g. readRenderTargetPixelsAsync returns its result instead of writing into a destination buffer, padding rules apply).

    Treat this as "which method-signature contract should I follow?", not as "which physical GPU backend is running?". Probing the physical backend is captured separately in nativeWebGPUBackend.

    nativeWebGPUBackend: boolean

    True only when the active backend is native WebGPU, not WebGL fallback.

    framebufferYDown: boolean

    True when the effective framebuffer presented by the renderer has row 0 at the top of the viewport (real WebGPU; also WebGPURenderer running on its WebGL2 compat backend, which Three.js normalises to match real WebGPU). False when row 0 is at the bottom (THREE.WebGLRenderer).

    This is the canonical seam for shader-sampling Y orientation in the viewer:

    • createFullscreenTriangleGeometry emits V-inverted UVs when this is true (so that screen-bottom-left at NDC (-1,-1) samples the bottom row of the source target on top-down framebuffers). The false branch emits the straight-V UVs used by WebGL2's bottom-up framebuffer. Either way the resulting vUv resolves to the canvas-relative UV at every fragment.
    • readPixelsCompactAsync returns rows in canonical top-down order; its readback conversion follows readbackYDown separately.

    Disambiguates from apiSurface: in practice both fields move together today (every WebGPURenderer reports framebufferYDown=true), but they answer different questions. apiSurface is the method-signature contract (e.g. readRenderTargetPixelsAsync's shape); this field is the sampling convention, not readback memory layout. Future Three.js versions could conceivably introduce a WebGPURenderer configuration whose effective Y differs, which is why we keep this as a separate capability rather than aliasing apiSurface.

    readbackYDown: boolean

    True when the running backend reads target rows and region Y from the top.

    HDR / wide-gamut / float-texture detection.

    hdrOutput?: HdrOutputState

    PROTOTYPE (?hdr): set only when the canvas is an extended-range rgba16float WebGPU canvas. The final pass then tone-maps to [0, headroom] instead of [0, 1], 1.0 staying SDR white.

    maxMSAASamples: number

    Maximum MSAA sample count the GPU supports (0 if unsupported).

    maxTextureSize: number

    Maximum 2D texture dimension (MAX_TEXTURE_SIZE / maxTextureDimension2D). Sizes the gsplat splat-data texture (see rendering/element-texture-layout.ts): width is capped at min(4096, maxTextureSize) and height bounds per-node splat capacity.

    maxRenderbufferSize: number

    Maximum renderbuffer dimension (MAX_RENDERBUFFER_SIZE).

    pointSizeRange: readonly [number, number]

    [min, max] gl_PointSize range — used for debug logging.