API

Interface ExternalImageTexture2DOptions

Sampler, format, upload, and downscaling options for createTexture2DFromExternalImage.

interface ExternalImageTexture2DOptions {
    addressModeU?: GPUAddressMode;
    addressModeV?: GPUAddressMode;
    invertY?: boolean;
    magFilter?: GPUFilterMode;
    maxDimension?: number;
    minFilter?: GPUFilterMode;
    mipMaps?: boolean;
    premultiplyAlpha?: boolean;
    srgb?: boolean;
}

Hierarchy (View Summary)

Index
addressModeU?: GPUAddressMode

Address mode U. Default 'repeat'.

addressModeV?: GPUAddressMode

Address mode V. Default 'repeat'.

invertY?: boolean

Flip Y axis during upload. Default true (matches Babylon.js convention).

magFilter?: GPUFilterMode

Mag filter. Default 'linear'.

maxDimension?: number

Downscale when the larger source dimension exceeds this positive integer. Aspect ratio is preserved and smaller sources are never enlarged.

minFilter?: GPUFilterMode

Min filter. Default 'linear'.

mipMaps?: boolean

Generate mipmaps. Default true.

premultiplyAlpha?: boolean

Premultiply alpha at decode time. Default false (straight RGBA, matches PNG-on-disk). Set true for sprite atlases that will be rendered with a premultiplied blend pipeline (srcFactor: ONE); doing so produces mathematically correct soft edges and stacked translucency.

srgb?: boolean

Use sRGB format (rgba8unorm-srgb). Enables hardware sRGB→linear on sample. Use for color/albedo textures in PBR workflows. Default false.