Constructor
new TextureCube()
Extends
Members
anisotropy :Number
The number of samples taken along the axis through the pixel that has the highest density of texels. A higher value gives a less blurry result than a basic mipmap, at the cost of more texture samples being used. Use WebGLcapabilities#maxAnisotropy to find the maximum valid anisotropy value for the GPU; this value is usually a power of 2.
Type:
- Number
- Overrides
- Default Value
- 1
border :Number
WebGLTexture border. See WebGLTexture texImage2D(). Must be zero.
Type:
- Number
- Overrides
compare :t3d.COMPARE_FUNC|Undefined
Use for shadow sampler (WebGL 2.0 Only).
Type:
- t3d.
COMPARE_FUNC |Undefined
- Overrides
- Default Value
- undefined
encoding :t3d.TEXEL_ENCODING_TYPE
texture pixel encoding.
- Overrides
- Default Value
- t3d.TEXEL_ENCODING_TYPE.LINEAR
flipY
- Overrides
- Default Value
- false
format :t3d.PIXEL_FORMAT
WebGLTexture texel data format.
Type:
- Overrides
- Default Value
- t3d.PIXEL_FORMAT.RGBA
generateMipmaps :Boolean
Whether to generate mipmaps (if possible) for a texture. Set this to false if you are creating mipmaps manually.
Type:
- Boolean
- Overrides
- Default Value
- true
(readonly) id :Number
Unique number for this texture instance.
Type:
- Number
- Overrides
images :Array.<HTMLImageElement>
Images data for this texture.
Type:
- Array.<HTMLImageElement>
- Default Value
- []
internalformat :Null|t3d.PIXEL_FORMAT
The default value is null, the texture's internal format will be obtained using a combination of .format and .type. Users can also specify a specific internalFormat.
Type:
- Null |
t3d. PIXEL_FORMAT
- Overrides
- Default Value
- null
(readonly) isTexture :Boolean
Type:
- Boolean
- Overrides
- Default Value
- true
(readonly) isTextureCube :Boolean
Type:
- Boolean
- Default Value
- true
magFilter :t3d.TEXTURE_FILTER
How the texture is sampled when a texel covers more than one pixel.
Type:
- Overrides
- Default Value
- t3d.TEXTURE_FILTER.LINEAR
minFilter :t3d.TEXTURE_FILTER
How the texture is sampled when a texel covers less than one pixel.
Type:
- Overrides
- Default Value
- t3d.TEXTURE_FILTER.LINEAR_MIPMAP_LINEAR
mipmaps :Array.<HTMLImageElement>|Array.<Object>
Array of user-specified mipmaps (optional).
Type:
- Array.<HTMLImageElement> |
Array.<Object>
- Overrides
- Default Value
- []
premultiplyAlpha :Boolean
If set to true, the alpha channel, if present, is multiplied into the color channels when the texture is uploaded to the GPU. Note that this property has no effect for ImageBitmap. You need to configure on bitmap creation instead.
Type:
- Boolean
- Overrides
- Default Value
- false
type :t3d.PIXEL_TYPE
WebGLTexture texel data type.
Type:
- Overrides
- Default Value
- t3d.PIXEL_TYPE.UNSIGNED_BYTE
unpackAlignment :Number
Specifies the alignment requirements for the start of each pixel row in memory. The allowable values are 1 (byte-alignment), 2 (rows aligned to even-numbered bytes), 4 (word-alignment), and 8 (rows start on double-word boundaries).
Type:
- Number
- Overrides
- Default Value
- 4
version :Number
version code increse if texture changed. if version is still 0, this texture will be skiped.
Type:
- Number
- Overrides
- Default Value
- 0
wrapS :t3d.TEXTURE_WRAP
This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
Type:
- Overrides
- Default Value
- t3d.TEXTURE_WRAP.CLAMP_TO_EDGE
wrapT :t3d.TEXTURE_WRAP
This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
Type:
- Overrides
- Default Value
- t3d.TEXTURE_WRAP.CLAMP_TO_EDGE
Methods
addEventListener(type, listener, thisObjectopt)
Adds a listener to an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of event to listen to. | ||
listener | function | The function that gets called when the event is fired. | ||
thisObject | Object | <optional> | this | The Object of calling listener method. |
- Overrides
clone() → {t3d.TextureBase}
Returns a clone of this texture.
- Overrides
Returns:
- Type:
- t3d.
TextureBase
copy(source) → {t3d.TextureCube}
Copy the given cube texture into this texture.
Parameters:
Name | Type | Description |
---|---|---|
source | t3d. | The cube texture to be copied. |
- Overrides
Returns:
- Type:
- t3d.
TextureCube
dispatchEvent(event)
Fire an event.
Parameters:
Name | Type | Description |
---|---|---|
event | Object | The event that gets fired. |
- Overrides
dispose()
Dispatches a dispose event.
- Overrides
removeEventListener(type, listener, thisObjectopt)
Removes a listener from an event type.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | String | The type of the listener that gets removed. | ||
listener | function | The listener function that gets removed. | ||
thisObject | Object | <optional> | this | thisObject - The Object of calling listener method. |
- Overrides