new TextureCube()
Creates a cube texture made up of six images.
- Source:
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
- Inherited From:
- Default Value:
- 1
- Source:
border :number
WebGLTexture border.
See WebGLTexture texImage2D().
Must be zero.
Type:
- number
- Inherited From:
- Source:
compare :zen3d.WEBGL_COMPARE_FUNC|undefined
Use for shadow sampler (WebGL 2.0 Only).
Type:
- zen3d.WEBGL_COMPARE_FUNC | undefined
- Inherited From:
- Default Value:
- undefined
- Source:
encoding :zen3d.TEXEL_ENCODING_TYPE
texture pixel encoding.
Type:
- Inherited From:
- Default Value:
- zen3d.TEXEL_ENCODING_TYPE.LINEAR
- Source:
flipY
- Overrides:
- Default Value:
- false
- Source:
format :zen3d.WEBGL_PIXEL_FORMAT
WebGLTexture texel data format.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_PIXEL_FORMAT.RGBA
- Source:
generateMipmaps :boolean
Whether to generate mipmaps (if possible) for a texture.
Set this to false if you are creating mipmaps manually.
Type:
- boolean
- Inherited From:
- Default Value:
- true
- Source:
images :Array.<HTMLImageElement>
Images data for this texture.
Type:
- Array.<HTMLImageElement>
- Default Value:
- []
- Source:
internalformat :null|zen3d.WEBGL_PIXEL_FORMAT
WebGLTexture texel data internal format.
If null, internalformat is set to be same as format.
This must be null in WebGL 1.0.
Type:
- null | zen3d.WEBGL_PIXEL_FORMAT
- Inherited From:
- Default Value:
- null
- Source:
magFilter :zen3d.WEBGL_TEXTURE_FILTER
How the texture is sampled when a texel covers more than one pixel.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_TEXTURE_FILTER.LINEAR
- Source:
minFilter :zen3d.WEBGL_TEXTURE_FILTER
How the texture is sampled when a texel covers less than one pixel.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_TEXTURE_FILTER.LINEAR_MIPMAP_LINEAR
- Source:
mipmaps :Array.<HTMLImageElement>|Array.<Object>
Array of user-specified mipmaps (optional).
Type:
- Array.<HTMLImageElement> | Array.<Object>
- Inherited From:
- Default Value:
- []
- Source:
type :zen3d.WEBGL_PIXEL_TYPE
WebGLTexture texel data type.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_PIXEL_TYPE.UNSIGNED_BYTE
- Source:
(readonly) uuid :string
UUID of this texture instance.
This gets automatically assigned, so this shouldn't be edited.
Type:
- string
- Inherited From:
- Source:
version :number
version code increse if texture changed.
if version is still 0, this texture will be skiped.
Type:
- number
- Inherited From:
- Default Value:
- 0
- Source:
wrapS :zen3d.WEBGL_TEXTURE_WRAP
This defines how the texture is wrapped horizontally and corresponds to U in UV mapping.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_TEXTURE_WRAP.CLAMP_TO_EDGE
- Source:
wrapT :zen3d.WEBGL_TEXTURE_WRAP
This defines how the texture is wrapped vertically and corresponds to V in UV mapping.
Type:
- Inherited From:
- Default Value:
- zen3d.WEBGL_TEXTURE_WRAP.CLAMP_TO_EDGE
- Source:
Methods
(static) fromImage(imageArray) → {TextureCube}
Create TextureCube from images.
Parameters:
Name | Type | Description |
---|---|---|
imageArray |
Array.<HTMLImageElement> |
- Source:
Returns:
- The result Texture.
- Type
- TextureCube
(static) fromSrc(srcArray) → {TextureCube}
Create TextureCube from src array.
Parameters:
Name | Type | Description |
---|---|---|
srcArray |
Array.<string> |
- Source:
Returns:
- The result Texture.
- Type
- TextureCube
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. |
- Inherited From:
- Source:
clone() → {zen3d.TextureBase}
Returns a clone of this texture.
- Inherited From:
- Source:
Returns:
- Type
- zen3d.TextureBase
copy(source) → {zen3d.TextureBase}
Copy the given texture into this texture.
Parameters:
Name | Type | Description |
---|---|---|
source |
zen3d.TextureBase | The texture to be copied. |
- Overrides:
- Source:
Returns:
- Type
- zen3d.TextureBase
dispatchEvent(event)
Fire an event type.
Parameters:
Name | Type | Description |
---|---|---|
event |
Object | The event that gets fired. |
- Inherited From:
- Source:
dispose()
Dispatches a dispose event.
- Inherited From:
- Source:
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. |
- Inherited From:
- Source: