Parameters used to create a GPUCurtains

interface GPUCurtainsParams {
    camera?: CameraBasePerspectiveOptions;
    lights?: GPUCameraRendererLightParams;
    production?: boolean;
    adapterOptions?: GPURequestAdapterOptions;
    label?: string;
    pixelRatio?: number;
    preferredFormat?: GPUTextureFormat;
    alphaMode?: GPUCanvasAlphaMode;
    renderPass?: {
        useDepth: boolean;
        sampleCount: number;
        clearValue: GPUColor;
    };
    autoRender?: boolean;
    autoResize?: boolean;
    watchScroll?: boolean;
    container?: string | HTMLElement;
}

Hierarchy

Properties

An object defining camera perspective parameters

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

production?: boolean

Flag indicating whether we're running the production mode or not. If not, useful warnings could be logged to the console

adapterOptions?: GPURequestAdapterOptions

Additional options to use when requesting an GPUAdapter | adapter

label?: string

Optional label of this GPURenderer

pixelRatio?: number

Pixel ratio to use for rendering

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]

autoRender?: boolean

Whether GPUCurtains should create its own requestAnimationFrame loop to render or not

autoResize?: boolean

Whether GPUCurtains should handle all resizing by itself or not

watchScroll?: boolean

Whether GPUCurtains should listen to scroll event or not

container?: string | HTMLElement

HTMLElement or string representing an HTMLElement selector that will hold the WebGPU HTMLCanvasElement. Could be set later if not specified.