IInternalTextureLoader

This represents the required contract to create a new type of texture loader.

Hierarchy

  • IInternalTextureLoader

Index

Properties

supportCascades

Find examples in Playground
supportCascades: boolean

Defines wether the loader supports cascade loading the different faces.

Methods

canLoad

Find examples in Playground
  • This returns if the loader support the current file information.

    Parameters

    • extension: string

      defines the file extension of the file being loaded

    • textureFormatInUse: Nullable<string>

      defines the current compressed format in use iun the engine

    • fallback: Nullable<InternalTexture>

      defines the fallback internal texture if any

    • isBase64: boolean

      defines whether the texture is encoded as a base64

    • isBuffer: boolean

      defines whether the texture data are stored as a buffer

    Returns boolean

    true if the loader can load the specified file

getFallbackTextureUrl

Find examples in Playground
  • getFallbackTextureUrl(rootUrl: string, textureFormatInUse: Nullable<string>): Nullable<string>
  • Gets the fallback url in case the load fail. This can return null to allow the default fallback mecanism to work

    Parameters

    • rootUrl: string

      the url of the texture

    • textureFormatInUse: Nullable<string>

      defines the current compressed format in use iun the engine

    Returns Nullable<string>

    the fallback texture

loadCubeData

Find examples in Playground
  • loadCubeData(data: string | ArrayBuffer | (string | ArrayBuffer)[], texture: InternalTexture, createPolynomials: boolean, onLoad: Nullable<function>, onError: Nullable<function>): void
  • Uploads the cube texture data to the WebGl Texture. It has alreday been bound.

    Parameters

    • data: string | ArrayBuffer | (string | ArrayBuffer)[]

      contains the texture data

    • texture: InternalTexture

      defines the BabylonJS internal texture

    • createPolynomials: boolean

      will be true if polynomials have been requested

    • onLoad: Nullable<function>

      defines the callback to trigger once the texture is ready

    • onError: Nullable<function>

      defines the callback to trigger in case of error

    Returns void

loadData

Find examples in Playground
  • loadData(data: ArrayBuffer, texture: InternalTexture, callback: function): void
  • Uploads the 2D texture data to the WebGl Texture. It has alreday been bound once in the callback.

    Parameters

    • data: ArrayBuffer

      contains the texture data

    • texture: InternalTexture

      defines the BabylonJS internal texture

    • callback: function

      defines the method to call once ready to upload

        • (width: number, height: number, loadMipmap: boolean, isCompressed: boolean, done: function): void
        • Parameters

          • width: number
          • height: number
          • loadMipmap: boolean
          • isCompressed: boolean
          • done: function
              • (): void
              • Returns void

          Returns void

    Returns void

transformUrl

Find examples in Playground
  • transformUrl(rootUrl: string, textureFormatInUse: Nullable<string>): string
  • Transform the url before loading if required.

    Parameters

    • rootUrl: string

      the url of the texture

    • textureFormatInUse: Nullable<string>

      defines the current compressed format in use iun the engine

    Returns string

    the transformed texture

Generated using TypeDoc