Function createCanvasTexture

  • This function creates a texture and a sampler from a 2D canvas, and returns an object that contains attributes texture and sampler.

    Parameters

    • device: GPUDevice

      GPU device

    • canvas: HTMLCanvasElement

      the HTML canvas element

    • addressModeU: string = 'repeat'

      (optional) the addressing model for the u texture coordinate, defaulting to 'repeat'

    • addressModeV: string = 'repeat'

      (optional) the addressing model for the v texture coordinate, defaulting to 'repeat'

    Returns Promise<{
        sampler: GPUSampler;
        texture: GPUTexture;
    }>

Generated using TypeDoc