Interface IInternalTextureLoader
interface IInternalTextureLoader {
supportCascades: boolean;
loadCubeData(
data:
| ArrayBufferView<ArrayBufferLike>
| ArrayBufferView<ArrayBufferLike>[],
texture: InternalTexture,
createPolynomials: boolean,
onLoad: Nullable<(data?: any) => void>,
onError: Nullable<(message?: string, exception?: any) => void>,
options?: any,
): void;
loadData(
data: ArrayBufferView,
texture: InternalTexture,
callback: (
width: number,
height: number,
loadMipmap: boolean,
isCompressed: boolean,
done: () => void,
loadFailed?: boolean,
) => void,
options?: any,
): void;
}
supportCascades: boolean;
loadCubeData(
data:
| ArrayBufferView<ArrayBufferLike>
| ArrayBufferView<ArrayBufferLike>[],
texture: InternalTexture,
createPolynomials: boolean,
onLoad: Nullable<(data?: any) => void>,
onError: Nullable<(message?: string, exception?: any) => void>,
options?: any,
): void;
loadData(
data: ArrayBufferView,
texture: InternalTexture,
callback: (
width: number,
height: number,
loadMipmap: boolean,
isCompressed: boolean,
done: () => void,
loadFailed?: boolean,
) => void,
options?: any,
): void;
}
Properties
support Cascades
supportCascades: boolean
Defines whether the loader supports cascade loading the different faces.
Methods
load Cube Data
-
loadCubeData(
data:
| ArrayBufferView<ArrayBufferLike>
| ArrayBufferView<ArrayBufferLike>[],
texture: InternalTexture,
createPolynomials: boolean,
onLoad: Nullable<(data?: any) => void>,
onError: Nullable<(message?: string, exception?: any) => void>,
options?: any,
): voidUploads the cube texture data to the WebGL texture. It has already been bound.
Parameters
- data: ArrayBufferView<ArrayBufferLike> | ArrayBufferView<ArrayBufferLike>[]
contains the texture data
- texture: InternalTexture
defines the BabylonJS internal texture
- createPolynomials: boolean
will be true if polynomials have been requested
- onLoad: Nullable<(data?: any) => void>
defines the callback to trigger once the texture is ready
- onError: Nullable<(message?: string, exception?: any) => void>
defines the callback to trigger in case of error
Optionaloptions: anyoptions to be passed to the loader
Returns void
- data: ArrayBufferView<ArrayBufferLike> | ArrayBufferView<ArrayBufferLike>[]
load Data
-
loadData(
data: ArrayBufferView,
texture: InternalTexture,
callback: (
width: number,
height: number,
loadMipmap: boolean,
isCompressed: boolean,
done: () => void,
loadFailed?: boolean,
) => void,
options?: any,
): voidUploads the 2D texture data to the WebGL texture. It has already been bound once in the callback.
Parameters
- data: ArrayBufferView
contains the texture data
- texture: InternalTexture
defines the BabylonJS internal texture
- callback: (
width: number,
height: number,
loadMipmap: boolean,
isCompressed: boolean,
done: () => void,
loadFailed?: boolean,
) => voiddefines the method to call once ready to upload
Optionaloptions: anyoptions to be passed to the loader
Returns void
- data: ArrayBufferView
This represents the required contract to create a new type of texture loader.