Configuration for WebGPURenderer.

interface WebGPURendererParams {
    adapter?: WebGPUAdapterLike;
    alphaMode?: WebGPUCanvasAlphaMode;
    contextFormat?: string;
    destroyDeviceOnDestroy?: boolean;
    device?: WebGPUDeviceLike;
    deviceDescriptor?: object;
    logging?: boolean;
    requestAdapterOptions?: object;
    viewer?: Viewer;
}

Properties

Adapter used by WebGPURenderer.create. Ignored by the synchronous constructor because GPUAdapter.requestDevice is asynchronous.

Optional alpha mode override for configured view canvases.

By default transparent views use premultiplied; opaque views use opaque.

contextFormat?: string

Canvas texture format. Defaults to navigator.gpu.getPreferredCanvasFormat() when available, otherwise bgra8unorm.

destroyDeviceOnDestroy?: boolean

Whether WebGPURenderer.destroy should call device.destroy().

Defaults to false for injected devices and true for devices acquired by WebGPURenderer.create.

Pre-created WebGPU device.

Supplying this allows the synchronous WebGPURenderer.attachViewer method to satisfy the backend-neutral Renderer contract.

deviceDescriptor?: object

Descriptor used by WebGPURenderer.create when requesting a device.

logging?: boolean

Enables renderer error logging.

Default value is true.

requestAdapterOptions?: object

Options used by WebGPURenderer.create when requesting an adapter.

viewer?: Viewer

Viewer to attach during construction.

When no device is supplied, attachment still returns base!core.SDKErrorType.NotSupported; use WebGPURenderer.create to request a device first.