Parameters used to create a GPUCameraRenderer

interface GPUCameraRendererParams {
    camera?: CameraBasePerspectiveOptions;
    lights?: GPUCameraRendererLightParams;
    deviceManager: GPUDeviceManager;
    label?: string;
    container: string | HTMLElement;
    pixelRatio?: number;
    autoResize?: boolean;
    preferredFormat?: GPUTextureFormat;
    alphaMode?: GPUCanvasAlphaMode;
    renderPass?: {
        useDepth: boolean;
        sampleCount: number;
        clearValue: GPUColor;
    };
}

Hierarchy (view full)

Properties

An object defining camera perspective parameters

An object defining the maximum number of light to use when creating the GPUCameraRenderer.

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 HTMLCanvasElement | 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 HTMLCanvasElement | canvas element, and handle resizing by yourself.

preferredFormat?: GPUTextureFormat

Texture rendering GPUTextureFormat | preferred format

alphaMode?: GPUCanvasAlphaMode

Set the GPUCanvasContext | context alpha mode

renderPass?: {
    useDepth: boolean;
    sampleCount: number;
    clearValue: GPUColor;
}

The renderer RenderPass parameters

Type declaration

  • useDepth: boolean

    Whether the renderer RenderPass should handle depth. Default to true

  • sampleCount: number

    The renderer RenderPass sample count (i.e. whether it should use multisampled antialiasing). Default to 4

  • clearValue: GPUColor

    The GPUColor | color values to clear to before drawing the renderer RenderPass. Default to [0, 0, 0, 0]