Class Cubemap

A cubemap texture.

Hierarchy

Constructors

  • Creates a 2D texture.

    Parameters

    • context: Context

      The WebGL2 rendering context of the texture.

    • nxFace: Mipmap<CubemapMip>

      The negative X-axis face of the texture.

    • pxFace: Mipmap<CubemapMip>

      The positive X-axis face of the texture.

    • nyFace: Mipmap<CubemapMip>

      The negative Y-axis face of the texture.

    • pyFace: Mipmap<CubemapMip>

      The positive Y-axis face of the texture.

    • nzFace: Mipmap<CubemapMip>

      The negative Z-axis face of the texture.

    • pzFace: Mipmap<CubemapMip>

      The positive Z-axis face of the texture.

    • magFilter: TextureMagFilter = TextureMagFilter.NEAREST

      The magnification filter to use on the texture.

    • minFilter: TextureMinFilter = TextureMinFilter.NEAREST

      The minification filter to use on the texture.

    • wrapSFunction: TextureWrapFunction = TextureWrapFunction.REPEAT

      The function to use when wrapping the texture across the S-axis.

    • wrapTFunction: TextureWrapFunction = TextureWrapFunction.REPEAT

      The function to use when wrapping the texture across the T-axis.

    Returns Cubemap

Properties

context: Context

The rendering context of this texture.

internal: WebGLTexture

The WebGL texture represented by this object.

The binding point of this texture.

Accessors

Methods

  • Assigns this texture to a texture unit and binds it to its binding point.

    Parameters

    • textureUnit: number

      The texture unit.

    Returns void

  • Executes the given function with this texture bound, then re-binds the previously-bound texture.

    Type Parameters

    • T

    Parameters

    • f: ((texture) => T)

      The function to execute.

        • (texture): T
        • Parameters

          Returns T

    Returns T

    The return value of the executed function.

  • Creates a basic cubemap from image URLs. The cubemap will appear magenta until the images load.

    Parameters

    • context: Context

      The rendering context of the cubemap.

    • px: string

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

    • nx: string

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

    • py: string

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

    • ny: string

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

    • pz: string

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

    • nz: string

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

    Returns Cubemap

    A basic 2D texture.

  • Creates a basic cubemap from pixel sources.

    Parameters

    • context: Context

      The rendering context of the cubemap.

    • px: MipSource

      The pixel source of the positive X-axis face.

    • nx: MipSource

      The pixel source of the negative X-axis face.

    • py: MipSource

      The pixel source of the positive Y-axis face.

    • ny: MipSource

      The pixel source of the negative Y-axis face.

    • pz: MipSource

      The pixel source of the positive Z-axis face.

    • nz: MipSource

      The pixel source of the negative Z-axis face.

    Returns Cubemap

    A basic cubemap.

Generated using TypeDoc