API/core/TextureCubeMap/

TextureCubeMap

Cube texture.

Hierarchy: Texture

constructor 

new TextureCubeMap(engine: Engine, size: number, format: TextureFormat, mipmap: boolean)

Create TextureCube.

Parameters

  • engine

    Define the engine to use to render this texture

  • size

    Texture size. texture width must be equal to height in cube texture

  • format

    Texture format,default TextureFormat.R8G8B8A8

  • mipmap

    Whether to use multi-level texture

instanceId ReadOnly

instanceId: number = ++EngineObject._instanceIdCounter

Engine unique id.

isGCIgnored 

isGCIgnored: boolean = false

Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc().

name 

name: string

anisoLevel 

get anisoLevel(): number

Anisotropic level for texture.

set anisoLevel(number): void

destroyed 

get destroyed(): boolean

Whether it has been destroyed.

filterMode 

get filterMode(): TextureFilterMode

Filter mode for texture.

set filterMode(TextureFilterMode): void

format 

get format(): TextureFormat

Texture format.

readonly

height 

get height(): number

The height of the texture.

readonly

mipmapCount 

get mipmapCount(): number

Texture mipmapping count.

readonly

refCount 

get refCount(): number

Counted by valid references.

width 

get width(): number

The width of the texture.

readonly

wrapModeU 

get wrapModeU(): TextureWrapMode

Wrapping mode for texture coordinate S.

set wrapModeU(TextureWrapMode): void

wrapModeV 

get wrapModeV(): TextureWrapMode

Wrapping mode for texture coordinate T.

set wrapModeV(TextureWrapMode): void

destroy 

destroy(force: boolean): boolean

Destroy self.

Parameters

  • force

    Whether to force the destruction, if it is fasle, refCount = 0 can be released successfully.

Returns

Whether the release was successful.

generateMipmaps 

generateMipmaps(): void

Generate multi-level textures based on the 0th level data.

getPixelBuffer 

getPixelBuffer(face: TextureCubeFace, x: number, y: number, width: number, height: number, out: ArrayBufferView): void

Get the pixel color buffer according to the specified cube face and area.

Parameters

  • face

    You can choose which cube face to read

  • x

    X coordinate of area start

  • y

    Y coordinate of area start

  • width

    Area width

  • height

    Area height

  • out

    Color buffer

setImageSource 

setImageSource(face: TextureCubeFace, imageSource: TexImageSource, mipLevel: number, flipY: boolean, premultiplyAlpha: boolean, x: number, y: number): void

Setting pixels data through cube face, TexImageSource, designated area and texture mipmapping level.

Parameters

  • face

    Cube face

  • imageSource

    The source of texture

  • mipLevel

    Texture mipmapping level

  • flipY

    Whether to flip the Y axis

  • premultiplyAlpha

  • optionalx

    X coordinate of area start

  • optionaly

    Y coordinate of area start

setPixelBuffer 

setPixelBuffer(face: TextureCubeFace, colorBuffer: ArrayBufferView, mipLevel: number, x: number, y: number, width: number, height: number): void

Setting pixels data through cube face,color buffer data, designated area and texture mipmapping level,it's also applicable to compressed formats.

remarksWhen compressed texture is in WebGL1, the texture must be filled first before writing the sub-region

Parameters

  • face

    Cube face

  • colorBuffer

    Color buffer data

  • mipLevel

    Texture mipmapping level

  • optionalx

    X coordinate of area start

  • optionaly

    Y coordinate of area start

  • optionalwidth

    Data width.if it's empty, width is the width corresponding to mipLevel minus x , width corresponding to mipLevel is Math.max(1, this.width >> mipLevel)

  • optionalheight

    Data height.if it's empty, height is the height corresponding to mipLevel minus y , height corresponding to mipLevel is Math.max(1, this.height >> mipLevel)