Options used to create a GPUCurtains

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

Hierarchy (view full)

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

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

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