API

Interface Texture2DOptions

Sampler, format, and decode options for loadTexture2D().

interface Texture2DOptions {
    addressModeU?: GPUAddressMode;
    addressModeV?: GPUAddressMode;
    invertY?: boolean;
    magFilter?: GPUFilterMode;
    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'.

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.