CubeTexture

Hierarchy

Index

Constructors

constructor

  • new CubeTexture(rootUrl: string, scene: Scene, extensions?: Nullable<string[]>, noMipmap?: boolean, files?: Nullable<string[]>, onLoad?: Nullable<function>, onError?: Nullable<function>, format?: number, prefiltered?: boolean, forcedExtension?: any, createPolynomials?: boolean, lodScale?: number, lodOffset?: number): CubeTexture
  • Creates a cube texture to use with reflection for instance. It can be based upon dds or six images as well as prefiltered data.

    Parameters

    • rootUrl: string

      defines the url of the texture or the root name of the six images

    • scene: Scene

      defines the scene the texture is attached to

    • Optional extensions: Nullable<string[]>

      defines the suffixes add to the picture name in case six images are in use like _px.jpg...

    • Optional noMipmap: boolean

      defines if mipmaps should be created or not

    • Optional files: Nullable<string[]>

      defines the six files to load for the different faces

    • Optional onLoad: Nullable<function>

      defines a callback triggered at the end of the file load if no errors occured

    • Optional onError: Nullable<function>

      defines a callback triggered in case of error during load

    • Optional format: number

      defines the internal format to use for the texture once loaded

    • Optional prefiltered: boolean

      defines whether or not the texture is created from prefiltered data

    • Optional forcedExtension: any

      defines the extensions to use (force a special type of file to load) in case it is different from the file name

    • Optional createPolynomials: boolean

      defines whether or not to create polynomial harmonics from the texture data if necessary

    • Optional lodScale: number

      defines the scale applied to environment texture. This manages the range of LOD level used for IBL according to the roughness

    • Optional lodOffset: number

      defines the offset applied to environment texture. This manages first LOD level used for IBL according to the roughness

    Returns CubeTexture

    the cube texture

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

delayLoadState

delayLoadState: number

gammaSpace

gammaSpace: boolean

getAlphaFromRGB

getAlphaFromRGB: boolean

hasAlpha

hasAlpha: boolean

invertZ

invertZ: boolean

is3D

is3D: boolean

isBlocking

isBlocking: boolean

isCube

isCube: boolean

isRGBD

isRGBD: boolean

Gets whether or not the texture contains RGBD data.

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

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, level?: number): Nullable<ArrayBufferView>
  • Reads the pixels stored in the webgl texture and returns them as an ArrayBuffer. This will returns an RGBA array buffer containing either in values (0-255) or float values (0-1) depending of the underlying buffer type.

    Parameters

    • Optional faceIndex: number

      The face of the texture to read (in case of cube texture)

    • Optional level: number

      The LOD level of the texture to read (in case of Mip Maps)

    Returns Nullable<ArrayBufferView>

    The Array buffer containing the pixels data.

releaseInternalTexture

  • releaseInternalTexture(): void

scale

  • scale(ratio: number): void

serialize

  • serialize(): any

setReflectionTextureMatrix

  • setReflectionTextureMatrix(value: Matrix): void
  • Parameters

    Returns void

toString

  • toString(): string

Static CreateFromImages

  • CreateFromImages(files: string[], scene: Scene, noMipmap?: boolean): CubeTexture
  • Parameters

    • files: string[]
    • scene: Scene
    • Optional noMipmap: boolean

    Returns CubeTexture

Static CreateFromPrefilteredData

  • CreateFromPrefilteredData(url: string, scene: Scene, forcedExtension?: any, createPolynomials?: boolean): CubeTexture
  • Creates and return a texture created from prefilterd data by tools like IBL Baker or Lys.

    Parameters

    • url: string

      defines the url of the prefiltered texture

    • scene: Scene

      defines the scene the texture is attached to

    • Optional forcedExtension: any

      defines the extension of the file if different from the url

    • Optional createPolynomials: boolean

      defines whether or not to create polynomial harmonics from the texture data if necessary

    Returns CubeTexture

    the prefiltered texture

Static Parse

  • Parameters

    • parsedTexture: any
    • scene: Scene
    • rootUrl: string

    Returns CubeTexture

Static WhenAllReady

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

Generated using TypeDoc