HDRCubeTextureAssetTask

Define a task used by {BABYLON.AssetsManager} to load HDR cube textures

Hierarchy

Implements

Index

Constructors

constructor

  • new HDRCubeTextureAssetTask(name: string, url: string, size?: number | undefined, noMipmap?: boolean, generateHarmonics?: boolean, useInGammaSpace?: boolean, usePMREMGenerator?: boolean): HDRCubeTextureAssetTask
  • Creates a new HDRCubeTextureAssetTask object

    Parameters

    • name: string

      defines the name of the task

    • url: string

      defines the location of the file to load

    • Optional size: number | undefined

      defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.

    • Optional noMipmap: boolean

      defines if mipmaps should not be generated (default is false)

    • Optional generateHarmonics: boolean

      specifies whether you want to extract the polynomial harmonics during the generation process (default is true)

    • Optional useInGammaSpace: boolean

      specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)

    • Optional usePMREMGenerator: boolean

      specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)

    Returns HDRCubeTextureAssetTask

Properties

errorObject

errorObject: object

Gets the current error object (if task is in error)

Type declaration

  • Optional exception?: any
  • Optional message?: string

generateHarmonics

generateHarmonics: boolean

Specifies whether you want to extract the polynomial harmonics during the generation process (default is true)

isCompleted

isCompleted: boolean

Get if the task is completed

name

name: string

Defines the name of the task

noMipmap

noMipmap: boolean

Defines if mipmaps should not be generated (default is false)

onError

onError: function

Callback called when the task is successful

Type declaration

onSuccess

onSuccess: function

Callback called when the task is successful

Type declaration

size

size: number | undefined

Defines the desired size (the more it increases the longer the generation will be) If the size is omitted this implies you are using a preprocessed cubemap.

taskState

taskState: AssetTaskState

Gets the current state of the task

texture

Gets the loaded texture

url

url: string

Defines the location of the file to load

useInGammaSpace

useInGammaSpace: boolean

Specifies if the texture will be use in gamma or linear space (the PBR material requires those texture in linear space, but the standard material would require them in Gamma space) (default is false)

usePMREMGenerator

usePMREMGenerator: boolean

Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time (default is false)

Methods

run

  • run(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

runTask

  • runTask(scene: Scene, onSuccess: function, onError: function): void
  • Execute the current task

    Parameters

    • scene: Scene

      defines the scene where you want your assets to be loaded

    • onSuccess: function

      is a callback called when the task is successfully executed

        • (): void
        • Returns void

    • onError: function

      is a callback called if an error occurs

        • (message?: string, exception?: any): void
        • Parameters

          • Optional message: string
          • Optional exception: any

          Returns void

    Returns void

Generated using TypeDoc