API

Interface ITextureCreationOptions

Defines the available options when creating a texture

interface ITextureCreationOptions {
    buffer?: Nullable<
        | string
        | ArrayBuffer
        | ArrayBufferView<ArrayBufferLike>
        | HTMLImageElement
        | ImageBitmap
        | Blob,
    >;
    creationFlags?: number;
    deleteBuffer?: boolean;
    forcedExtension?: string;
    format?: number;
    gammaSpace?: boolean;
    internalTexture?: InternalTexture;
    invertY?: boolean;
    loaderOptions?: any;
    mimeType?: string;
    noMipmap?: boolean;
    onError?: Nullable<(message?: string, exception?: any) => void>;
    onLoad?: Nullable<() => void>;
    samplingMode?: number;
    useSRGBBuffer?: boolean;
}

Hierarchy (View Summary)

Index
buffer?: Nullable<
    | string
    | ArrayBuffer
    | ArrayBufferView<ArrayBufferLike>
    | HTMLImageElement
    | ImageBitmap
    | Blob,
>

Defines the buffer to load the texture from in case the texture is loaded from a buffer representation (default: null)

creationFlags?: number

Specific flags to use when creating the texture (Constants.TEXTURE_CREATIONFLAG_STORAGE for storage textures, for eg) (default: undefined)

deleteBuffer?: boolean

Defines if the buffer we are loading the texture from should be deleted after load (default: false)

forcedExtension?: string

Defines the extension to use to pick the right loader

format?: number

Defines the format of the texture we are trying to load (Engine.TEXTUREFORMAT_RGBA...) (default: )

gammaSpace?: boolean

Defines the underlying texture texture space

internalTexture?: InternalTexture

Defines the underlying texture from an already existing one

invertY?: boolean

Defines if the texture needs to be inverted on the y axis during loading (default: true)

loaderOptions?: any

Options to be passed to the loader (default: undefined)

mimeType?: string

Defines an optional mime type information (default: undefined)

noMipmap?: boolean

Defines if the texture will require mip maps or not (default: false)

onError?: Nullable<(message?: string, exception?: any) => void>

Defines a callback triggered when an error occurred during the loading session (default: null)

onLoad?: Nullable<() => void>

Defines a callback triggered when the texture has been loaded (default: null)

samplingMode?: number

Defines the sampling mode we want for the texture while fetching from it (Texture.NEAREST_SAMPLINGMODE...) (default: Texture.TRILINEAR_SAMPLINGMODE)

useSRGBBuffer?: boolean

Defines if the texture must be loaded in a sRGB GPU buffer (if supported by the GPU) (default: false)