HDRCubeTexture

This represents a texture coming from an HDR input.

The only supported format is currently panorama picture stored in RGBE format. Example of such files can be found on HDRLib: http://hdrlib.com/

Hierarchy

Index

Constructors

constructor

  • new HDRCubeTexture(url: string, scene: Scene, size?: number, noMipmap?: boolean, generateHarmonics?: boolean, useInGammaSpace?: boolean, usePMREMGenerator?: boolean, onLoad?: Nullable<function>, onError?: Nullable<function>): HDRCubeTexture
  • Instantiates an HDRTexture from the following parameters.

    Parameters

    • url: string

      The location of the HDR raw data (Panorama stored in RGBE format)

    • scene: Scene

      The scene the texture will be used in

    • Optional size: number

      The cubemap 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

      Forces to not generate the mipmap if true

    • Optional generateHarmonics: boolean

      Specifies whether you want to extract the polynomial harmonics during the generation process

    • 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)

    • Optional usePMREMGenerator: boolean

      Specifies whether or not to generate the CubeMap through CubeMapGen to avoid seams issue at run time.

    • Optional onLoad: Nullable<function>
    • Optional onError: Nullable<function>

    Returns HDRCubeTexture

Properties

animations

animations: Animation[]

anisotropicFilteringLevel

anisotropicFilteringLevel: number

boundingBoxPosition

boundingBoxPosition: Vector3

Gets or sets the center of the bounding box associated with the cube texture It must define where the camera used to render the texture was set

boundingBoxSize

boundingBoxSize: Vector3

Gets or sets the size of the bounding box associated with the cube texture When defined, the cubemap will switch to local mode

see

https://community.arm.com/graphics/b/blog/posts/reflections-based-on-local-cubemaps-in-unity

example

https://www.babylonjs-playground.com/#RNASML

canRescale

canRescale: boolean

coordinatesIndex

coordinatesIndex: number

coordinatesMode

coordinatesMode: number

The texture coordinates mode. As this texture is stored in a cube format, please modify carefully.

delayLoadState

delayLoadState: number

gammaSpace

gammaSpace: boolean

getAlphaFromRGB

getAlphaFromRGB: boolean

hasAlpha

hasAlpha: boolean

invertZ

invertZ: boolean

is3D

is3D: boolean

isBlocking

isBlocking: boolean

Sets wether or not the texture is blocking during loading.

isCube

isCube: boolean

isPMREM

isPMREM: boolean

Specifies wether the texture has been generated through the PMREMGenerator tool. This is usefull at run time to apply the good shader.

isRenderTarget

isRenderTarget: boolean

level

level: number

lodGenerationOffset

lodGenerationOffset: number

lodGenerationScale

lodGenerationScale: number

lodLevelInAlpha

lodLevelInAlpha: boolean

name

name: string

onDispose

onDispose: function

Type declaration

    • (): void
    • Returns void

onDisposeObservable

onDisposeObservable: Observable<BaseTexture>

An event triggered when the texture is disposed.

rotationY

rotationY: number

Sets texture matrix rotation angle around Y axis in radians.

sphericalPolynomial

sphericalPolynomial: Nullable<SphericalPolynomial>

textureFormat

textureFormat: number

textureType

textureType: number

uid

uid: string

url

url: string

The texture URL.

wrapR

wrapR: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

wrapU

wrapU: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

wrapV

wrapV: number
Value Type Description
0 CLAMP_ADDRESSMODE
1 WRAP_ADDRESSMODE
2 MIRROR_ADDRESSMODE

Static DEFAULT_ANISOTROPIC_FILTERING_LEVEL

DEFAULT_ANISOTROPIC_FILTERING_LEVEL: number

Methods

clone

delayLoad

  • delayLoad(): void

dispose

  • dispose(): void

getBaseSize

getClassName

  • getClassName(): string

getInternalTexture

getReflectionTextureMatrix

  • getReflectionTextureMatrix(): Matrix

getScene

getSize

getTextureMatrix

isReady

  • isReady(): boolean

isReadyOrNotBlocking

  • isReadyOrNotBlocking(): boolean

readPixels

  • readPixels(faceIndex?: number): Nullable<ArrayBufferView>

releaseInternalTexture

  • releaseInternalTexture(): void

scale

  • scale(ratio: number): void

serialize

  • serialize(): any

setReflectionTextureMatrix

  • setReflectionTextureMatrix(value: Matrix): void
  • Parameters

    Returns void

toString

  • toString(): string

Static Parse

Static WhenAllReady

  • WhenAllReady(textures: BaseTexture[], callback: function): void

Static generateBabylonHDR

  • generateBabylonHDR(url: string, size: number, callback: function, onError?: Nullable<function>): void
  • Serializes the data contained in the texture in a binary format. This can be used to prevent the long loading tie associated with creating the seamless texture as well as the spherical used in the lighting.

    Parameters

    • url: string

      The HDR file url.

    • size: number

      The size of the texture data to generate (one of the cubemap face desired width).

    • callback: function
        • (ArrayBuffer: ArrayBuffer): void
        • Parameters

          • ArrayBuffer: ArrayBuffer

          Returns void

    • Optional onError: Nullable<function>

      Method called if any error happens during download.

    Returns void

    The packed binary data.

Static generateBabylonHDROnDisk

  • generateBabylonHDROnDisk(url: string, size: number, onError?: Nullable<function>): void
  • Saves as a file the data contained in the texture in a binary format. This can be used to prevent the long loading tie associated with creating the seamless texture as well as the spherical used in the lighting.

    Parameters

    • url: string

      The HDR file url.

    • size: number

      The size of the texture data to generate (one of the cubemap face desired width).

    • Optional onError: Nullable<function>

      Method called if any error happens during download.

    Returns void

    The packed binary data.

Generated using TypeDoc