TextureCubeMap

TextureCubeMap

A texture class to represent a cube map texture.

Constructor

new TextureCubeMap(spec, callback)

Instantiates a TextureCubeMap object.
Source:
Parameters:
Name Type Description
spec Object The specification arguments.
Name Type Description
faces Object The faces to buffer, under keys '+x', '+y', '+z', '-x', '-y', and '-z'.
width number The width of the faces.
height number The height of the faces.
wrap string The wrapping type over both S and T dimension.
wrapS string The wrapping type over the S dimension.
wrapT string The wrapping type over the T dimension.
filter string The min / mag filter used during scaling.
minFilter string The minification filter used during scaling.
magFilter string The magnification filter used during scaling.
mipMap bool Whether or not mip-mapping is enabled.
invertY bool Whether or not invert-y is enabled.
premultiplyAlpha bool Whether or not alpha premultiplying is enabled.
format string The texture pixel format.
type string The texture pixel component type.
callback function The callback to be executed if the data is loaded asynchronously via a URL.

Methods

bind(location) → {TextureCubeMap}

Binds the texture object to the provided texture unit location.
Source:
Parameters:
Name Type Default Description
location number 0 The texture unit location index. Defaults to 0.
Returns:
Type:
TextureCubeMap
The texture object, for chaining.

bufferData(target, data) → {TextureCubeMap}

Buffer data into the respective cube map face.
Source:
Parameters:
Name Type Description
target string The face target.
data Object | null The face data.
Returns:
Type:
TextureCubeMap
The texture object, for chaining.

setParameters(params) → {TextureCubeMap}

Set the texture parameters.
Source:
Parameters:
Name Type Description
params Object The parameters by name.
Name Type Description
wrap string The wrapping type over both S and T dimension.
wrapS string The wrapping type over the S dimension.
wrapT string The wrapping type over the T dimension.
filter string The min / mag filter used during scaling.
minFilter string The minification filter used during scaling.
magFilter string The magnification filter used during scaling.
Returns:
Type:
TextureCubeMap
The texture object, for chaining.

unbind() → {TextureCubeMap}

Unbinds the texture object.
Source:
Returns:
Type:
TextureCubeMap
- The texture object, for chaining.