Parameters used to create a GPURenderer.

interface GPURendererParams {
    deviceManager: GPUDeviceManager;
    label?: string;
    container: string | HTMLElement;
    pixelRatio?: number;
    autoResize?: boolean;
    context?: GPURendererContextParams;
    renderPass?: {
        useDepth?: boolean;
        sampleCount?: number;
        colorAttachments?: [
            Partial<ColorAttachmentParams>,
            ...ColorAttachmentParams[],
        ];
    };
}

Hierarchy (View Summary)

Properties

deviceManager: GPUDeviceManager

The GPUDeviceManager used to create this GPURenderer.

label?: string

Optional label of this GPURenderer.

container: string | HTMLElement

HTMLElement or selector used as a container for our canvas. Could also be directly a canvas element.

pixelRatio?: number

Pixel ratio to use for rendering.

autoResize?: boolean

Whether to auto resize the renderer each time its GPURenderer#domElement size changes or not. It is advised to set this parameter to false if the provided container is a canvas element, and handle resizing by yourself.

Options used to configure this GPURenderer context. If not specified, format will be set with GPU.getPreferredCanvasFormat() and alphaMode with premultiplied.

renderPass?: {
    useDepth?: boolean;
    sampleCount?: number;
    colorAttachments?: [
        Partial<ColorAttachmentParams>,
        ...ColorAttachmentParams[],
    ];
}

The renderer RenderPass parameters.

Type declaration