Class SpiderGL.WebGL.TextureCubeMap
The SpiderGL.WebGL.TextureCubeMap is a wrapper for cube map WebGLTexture objects
- Defined in: webgl.js
- Extends SpiderGL.WebGL.Texture
Constructor Attributes | Constructor Name and Description |
---|---|
SpiderGL.WebGL.TextureCubeMap(gl, options)
Creates a SpiderGL.WebGL.TextureCubeMap.
|
- Fields borrowed from class SpiderGL.WebGL.Texture:
- autoMipmap, colorspaceConversionPolicy, flipYPolicy, format, height, isReady, magFilter, minFilter, premultuplyAlphaPolicy, width, wrapS, wrapT
- Fields borrowed from class SpiderGL.WebGL.ObjectGL:
- gl, handle, isValid, target
- Fields borrowed from class SpiderGL.Core.ObjectBase:
- uid
Method Summary
Method Attributes | Method Name and Description |
---|---|
setImage(face, options)
Sets the texture image for a cube face.
|
|
setSubImage(face, options)
Sets a region of the texture image for a cube face.
|
|
<static> |
SpiderGL.WebGL.TextureCubeMap.unbind(gl, unit)
|
- Methods borrowed from class SpiderGL.WebGL.Texture:
- bind
- destroy
- generateMipmap
- getSampler
- setSampler
Class Detail
SpiderGL.WebGL.TextureCubeMap(gl, options)
Creates a SpiderGL.WebGL.TextureCubeMap.
SpiderGL.WebGL.TextureCubeMap is a wrapper for cube map WebGLTexture objects.
- Parameters:
- {WebGLRenderingContext} gl
- A WebGLRenderingContext hijacked with SpiderGL.WebGL.Context.hijack.
- {object} options Optional
- Optional parameters (see SpiderGL.WebGL.Texture constructor). This constructor accepts only the url options as an array of six strings, or internalFormat, width, height, format and type, ignoring the data property.
Method Detail
-
setImage(face, options)Sets the texture image for a cube face.
- Parameters:
- {number} face
- The cube map face to set.
- {object} options
- The image data and type parameters (see SpiderGL.WebGL.Texture constructor).
- {ArrayBuffer|ArrayBufferView|ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} options.data Optional
- The texture image pixel data.
- {number} options.internalFormat Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_INTERNAL_FORMAT
- The texture internal format.
- {number} options.width Optional
- If data is null or a typed array, specifies the texture image width. If handle is provided, the width parameter will supply the width information, not querable to the WebGLRenderingContext.
- {number} options.height Optional
- If data is null or a typed array, specifies the texture image height. If handle is provided, the width parameter will supply the height information, not querable to the WebGLRenderingContext.
- {number} options.border Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_BORDER
- Texture border.
- {number} options.format Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_FORMAT
- The format parameter used for WebGLRenderingContext.texImage2D.
- {number} options.type Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_TYPE
- The type parameter used for WebGLRenderingContext.texImage2D.
- {bool} options.generateMipmap Optional
- If specified, overrides autoMipmap.
- {bool} options.flipY Optional
- If specified, overrides flipYPolicy.
- {bool} options.premultiplyAlpha Optional
- If specified, overrides premultiplyAlphaPolicy.
- {number} options.colorspaceConversion Optional
- If specified, overrides colorspaceConversionPolicy.
- {function} options.onAbort Optional
- If url is specified, this function will be called if image data loading is aborted.
- {function} options.onError Optional
- If url is specified, this function will be called if an error occurs when loading image data.
- {function} options.onLoad Optional
- If url is specified, this function will be called when image data has been loaded.
- See:
- setSubImage
- SpiderGL.WebGL.Texture
-
setSubImage(face, options)Sets a region of the texture image for a cube face.
- Parameters:
- {number} face
- The cube map face to set.
- {object} options
- The image data and type parameters (see SpiderGL.WebGL.Texture constructor).
- {ArrayBuffer|ArrayBufferView|ImageData|HTMLImageElement|HTMLCanvasElement|HTMLVideoElement} options.data Optional
- The texture sub-image pixel data.
- {number} options.xoffset Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_X_OFFSET
- The sub-image x offset.
- {number} options.yoffset Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_Y_OFFSET
- The sub-image y offset.
- {number} options.width Optional
- If data is null or a typed array, specifies the texture image width. If handle is provided, the width parameter will supply the width information, not querable to the WebGLRenderingContext.
- {number} options.height Optional
- If data is null or a typed array, specifies the texture image height. If handle is provided, the width parameter will supply the height information, not querable to the WebGLRenderingContext.
- {number} options.border Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_BORDER
- Texture border.
- {number} options.format Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_FORMAT
- The format parameter used for WebGLRenderingContext.texSubImage2D.
- {number} options.type Optional, Default: SpiderGL.WebGL.Texture.DEFAULT_TYPE
- The type parameter used for WebGLRenderingContext.texSubImage2D.
- {bool} options.generateMipmap Optional
- If specified, overrides autoMipmap.
- {bool} options.flipY Optional
- If specified, overrides flipYPolicy.
- {bool} options.premultiplyAlpha Optional
- If specified, overrides premultiplyAlphaPolicy.
- {number} options.colorspaceConversion Optional
- If specified, overrides colorspaceConversionPolicy.
- {function} options.onAbort Optional
- If url is specified, this function will be called if image data loading is aborted.
- {function} options.onError Optional
- If url is specified, this function will be called if an error occurs when loading image data.
- {function} options.onLoad Optional
- If url is specified, this function will be called when image data has been loaded.
- See:
- setImage
- SpiderGL.WebGL.Texture
-
<static> SpiderGL.WebGL.TextureCubeMap.unbind(gl, unit)
- Parameters:
- gl
- unit