EnvironmentTextureTools

Sets of helpers addressing the serialization and deserialization of environment texture stored in a BabylonJS env file. Those files are usually stored as .env files.

Hierarchy

  • EnvironmentTextureTools

Index

Methods

Static CreateEnvTextureAsync

  • CreateEnvTextureAsync(texture: CubeTexture): Promise<ArrayBuffer>
  • Creates an environment texture from a loaded cube texture.

    Parameters

    • texture: CubeTexture

      defines the cube texture to convert in env file

    Returns Promise<ArrayBuffer>

    a promise containing the environment data if succesfull.

Static GetEnvInfo

  • Gets the environment info from an env file.

    Parameters

    • data: ArrayBuffer

      The array buffer containing the .env bytes.

    Returns Nullable<EnvironmentTextureInfo>

    the environment file info (the json header) if successfully parsed.

Static UploadEnvLevelsAsync

  • Uploads the texture info contained in the env file to the GPU.

    Parameters

    • texture: InternalTexture

      defines the internal texture to upload to

    • arrayBuffer: any

      defines the buffer cotaining the data to load

    • info: EnvironmentTextureInfo

      defines the texture info retrieved through the GetEnvInfo method

    Returns Promise<void>

    a promise

Static UploadEnvSpherical

  • Uploads spherical polynomials information to the texture.

    Parameters

    • texture: InternalTexture

      defines the texture we are trying to upload the information to

    • info: EnvironmentTextureInfo

      defines the environment texture info retrieved through the GetEnvInfo method

    Returns void

Static UploadLevelsAsync

  • UploadLevelsAsync(texture: InternalTexture, imageData: ArrayBufferView[][]): Promise<void>
  • Uploads the levels of image data to the GPU.

    Parameters

    • texture: InternalTexture

      defines the internal texture to upload to

    • imageData: ArrayBufferView[][]

      defines the array buffer views of image data [mipmap][face]

    Returns Promise<void>

    a promise

Generated using TypeDoc