Constructor
new MtlTextureCache(webglContext)
Parameters:
| Name |
Type |
Description |
webglContext |
WebGL2RenderingContext
|
WebGL2 rendering context. |
- Source:
Throws:
-
When `webglContext` is not `WebGL2RenderingContext`.
-
-
Type
-
TypeError
Classes
- MtlTextureCache
Methods
(async) getTexture(url, output, optionsopt) → {Promise.<Texture2D>}
Returns cached or newly loaded texture.
Parameters:
| Name |
Type |
Attributes |
Description |
url |
string
|
|
Texture URL. |
output |
Array.<Texture2D>
|
|
Output list of created textures. |
options |
Object
|
<optional>
|
Texture options.
Properties
| Name |
Type |
Attributes |
Default |
Description |
clamp |
boolean
|
<optional>
|
false
|
When true, uses `clamp-to-edge` on both S and T-axes. |
wrapS |
number
|
<optional>
|
|
Optional wrap mode for S-axis. |
wrapT |
number
|
<optional>
|
|
Optional wrap mode for T-axis. |
|
- Source:
Throws:
-
When url or output are invalid.
-
-
Type
-
TypeError
Returns:
- Promise, that resolves with the cached or newly created `Texture2D` instance for the given URL.
-
Type
-
Promise.<Texture2D>