Class TextureCubemap

A cube mapped texture.

Hierarchy (view full)

Constructors

Accessors

  • get isImmutableFormat(): boolean
  • Whether or not this is an immutable-format texture.

    Returns boolean

  • get isTextureComplete(): boolean
  • Whether or not this texture is texture complete.

    Returns boolean

Methods

  • Get the dimensions of the mip at the given level.

    Parameters

    • level: number

      The level of the mip.

    Returns number[]

    The width, height (if applicable), and depth (if applicable) of the mip, in that order.

  • Make this texture into an immutable-format texture.

    Parameters

    • Optionallevels: number

      The number of levels in the texture, or undefined for one level.

    • Optionalformat: TextureFormat

      The internal format of the texture, or undefined to keep the current format (defaults to RGBA).

    • Optionaldims: number[]

      The dimensions of the texture, or undefined to keep the current dimensions.

    Returns void

    TextureFormatError if the given format is unsized.

  • Copy the data in a framebuffer into one of this texture's mips.

    Parameters

    • framebuffer: null | Framebuffer

      The framebuffer to copy into the mip, or null for the default framebuffer.

    • Optionallevel: number

      The level of the mip within its mipmap. Defaults to the top mip.

    • Optionalface: CubeFace

      The mipmap that the mip belongs to. Ignored by non-cubemap textures.

    • Optionalbounds: Rectangle | Prism

      The bounds of the mip to be updated. Defaults to the entire mip if not set.

    • Optionaltype: TextureDataType

      The type of the given data. Must be compatible with the format of the given data.

    • OptionalunpackAlignment:
          | 1
          | 2
          | 4
          | 8

      The alignment to use when unpacking the data, or undefined to let this be automatically determined.

    • Optionalarea: Rectangle | Prism

      The area of the framebuffer to copy into the mip.

    Returns void

    TextureFormatError if the given data type is incompatible with this texture's format.

  • Copy the data in a buffer into one of this texture's mips.

    Parameters

    • buffer: Vbo

      The buffer to copy into the mip.

    • level: undefined | number

      The level of the mip within its mipmap. Defaults to the top mip.

    • face: undefined | CubeFace

      The mipmap that the mip belongs to. Ignored by non-cubemap textures.

    • bounds: undefined | Rectangle | Prism

      The bounds of the mip to be updated. Defaults to the entire mip if not set.

    • type: undefined | TextureDataType

      The type of the given data. Must be compatible with the format of the given data.

    • unpackAlignment:
          | undefined
          | 1
          | 2
          | 4
          | 8

      The alignment to use when unpacking the data, or undefined to let this be automatically determined.

    • size: number

      The number of bytes of data to copy from the buffer.

    • offset: number

      The offset in bytes from the start of the buffer to start copying at.

    Returns void

    TextureFormatError if the given data type is incompatible with this texture's format.

  • Copy data into one of this texture's mips.

    Parameters

    • Optionaldata: TexImageSource

      The data to copy into the mip.

    • Optionallevel: number

      The level of the mip within its mipmap. Defaults to the top mip.

    • Optionalface: CubeFace

      The mipmap that the mip belongs to. Ignored by non-cubemap textures.

    • Optionalbounds: Rectangle | Prism

      The bounds of the mip to be updated. Defaults to the entire mip if not set.

    • Optionaltype: TextureDataType

      The type of the given data. Must be compatible with the format of the given data.

    • OptionalunpackAlignment:
          | 1
          | 2
          | 4
          | 8

      The alignment to use when unpacking the data, or undefined to let this be automatically determined.

    Returns void

    TextureFormatError if the given data type is incompatible with this texture's format.

  • Copy the data in an array into one of this texture's mips.

    Parameters

    • array: ArrayBufferView

      The array to copy into the mip.

    • Optionallevel: number

      The level of the mip within its mipmap. Defaults to the top mip.

    • Optionalface: CubeFace

      The mipmap that the mip belongs to. Ignored by non-cubemap textures.

    • Optionalbounds: Rectangle | Prism

      The bounds of the mip to be updated. Defaults to the entire mip if not set.

    • Optionaltype: TextureDataType

      The type of the given data. Must be compatible with the format of the given data.

    • OptionalunpackAlignment:
          | 1
          | 2
          | 4
          | 8

      The alignment to use when unpacking the data, or undefined to let this be automatically determined.

    • Optionaloffset: number

      The offset from the start of the array to start copying at, or undefined for the start of the array.

    • Optionallength: number

      The number of elements to copy from the array, or undefined for the entire array.

    Returns void

    TextureFormatError if the given data type is incompatible with this texture's format.

  • Create a cube mapped texture from the data in the images at the given URLs. The texture is initially filled with magenta and is later filled with the images once they load.

    Parameters

    • context: Context

      The rendering context of the texture.

    • px: string

      The URL of the image for the face on the X-axis in the positive direction.

    • nx: string

      The URL of the image for the face on the X-axis in the negative direction.

    • py: string

      The URL of the image for the face on the Y-axis in the positive direction.

    • ny: string

      The URL of the image for the face on the Y-axis in the negative direction.

    • pz: string

      The URL of the image for the face on the Z-axis in the positive direction.

    • nz: string

      The URL of the image for the face on the Z-axis in the negative direction.

    Returns TextureCubemap

    The texture.

  • Create a cube mapped texture from the data in the images at the given URLs.

    Parameters

    • context: Context

      The rendering context of the texture.

    • px: string

      The URL of the image for the face on the X-axis in the positive direction.

    • nx: string

      The URL of the image for the face on the X-axis in the negative direction.

    • py: string

      The URL of the image for the face on the Y-axis in the positive direction.

    • ny: string

      The URL of the image for the face on the Y-axis in the negative direction.

    • pz: string

      The URL of the image for the face on the Z-axis in the positive direction.

    • nz: string

      The URL of the image for the face on the Z-axis in the negative direction.

    Returns Promise<TextureCubemap>

    The texture.