Options used to create a GPUCurtains

interface GPUCurtainsOptions {
    camera?: CameraBasePerspectiveOptions;
    lights?: false | GPUCameraRendererLightParams;
    production?: boolean;
    adapterOptions?: GPURequestAdapterOptions;
    label?: string;
    container: string | HTMLElement;
    pixelRatio?: number;
    context?: GPURendererContextParams;
    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. Can be set to false to avoid creating lights and shadows buffers, but note this is a permanent choice and cannot be changed later.

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

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;
    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