Constructor
new TextureInfo(image, useWebGLopt, wrapopt)
Create a TextureInfo, called automatically by the engine
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
image | HTMLImageElement | | |||
useWebGL | boolean | <optional> | true | Should use WebGL if available? |
wrap | boolean | | <optional> | false | Should the texture wrap (REPEAT) or clamp (CLAMP_TO_EDGE)? Or the WebGL modes across and down, like [gl.CLAMP_TO_EDGE, gl.MIRRORED_REPEAT], as a glTF sampler gives them |
- Source
Members
glTexture :WebGLTexture|undefined
Type:
Properties- WebGLTexture |
undefined
| Type | Description |
|---|---|
| WebGLTexture | | WebGL texture |
- Source
image
Properties| Type | Description |
|---|---|
| HTMLImageElement | | image source |
- Source
size
Properties| Type | Description |
|---|---|
| Vector2 | size of the image |
- Source
sizeInverse
Properties| Type | Description |
|---|---|
| Vector2 | inverse of the size, cached for rendering |
- Source
wrap :boolean|Array.<number>
Type:
Properties- boolean |
Array.<number>
| Type | Description |
|---|---|
| boolean | | true for REPEAT wrap mode, false for CLAMP_TO_EDGE, or the WebGL modes across and down |
- Source
Methods
createWebGLTexture()
Creates the WebGL texture, updates if already created
- Source
destroyWebGLTexture()
Destroys the WebGL texture
- Source
hasWebGL() → {boolean}
Check if the texture is webgl enabled
- Source
Returns:
- Type:
- boolean
setWrap(wrapopt)
Set the wrap mode for this texture
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
wrap | boolean | | <optional> | true | true for REPEAT, false for CLAMP_TO_EDGE, or the WebGL modes across and down |
- Source