Options
All
  • Public
  • Public/Protected
  • All
Menu

Generic GPU texture store, wrapping WebGLTexture.

Hierarchy

  • default
    • TextureCube

Index

Properties

ready: Promise<void>

How supplied texture data is interpreted.

For non-compressed textures, this means included channels and channel formats. See TextureFormat.

For compressed textures, this is the actual storage format. See CompressedTextureStorageFormat

isCompressed: boolean = false
isPreallocated: boolean = true
minLod: number
maxLod: number
width: number

Texture width in pixels.

height: number

Texture height in pixels.

Methods

  • uploadLevelSync(target: TextureCubeFace | TextureBindingPoint, level: number, width: number, height: number, type: BufferDataType | TextureDataType, srcData: ArrayBufferView): void
  • bindSync(): boolean
  • If ready, binds the texture to the relevant binding point.

    Returns boolean

    true if the texture has been successfully bound, false otherwise.

  • Uploads an array of pixels to the GPU.

    example

    Uploading data for level 0 of the side facing forward (positive Z) and level 1 of the side facing left (negative X):

    await myCubemap.uploadPixels(
    {
    0: {
    pz: new Uint8Array([
    // ...
    ]),
    },
    1: {
    nx: new Uint8Array([
    // ...
    ]),
    },
    },
    BufferDataType.unsignedByte,
    );

    Parameters

    • pixelsPerLevel: {}

      An object containing the pixel data per level and face.

      • [level: number]: Partial<CubeOf<ArrayBufferView>>
    • type: BufferDataType | TextureDataType = BufferDataType.unsignedByte

      The format the pixel data is in. Ignored for compressed formats.

      Defaults to BufferDataType.unsignedByte

    Returns Promise<void>

Constructors

Generated using TypeDoc