Constructor
new TexturedMaterial(webglContext, optionsopt)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
webglContext |
WebGL2RenderingContext | WebGL2 rendering context used to create shaders and upload uniforms. | |
options |
TexturedMaterialOptions |
<optional> |
Optional configuration for the material. |
- Source:
Classes
Members
diffuseTexture
Returns the current diffuse texture.
- Source:
Methods
apply(matrix4)
Uploads uniforms and binds the texture for a draw call.
Parameters:
| Name | Type | Description |
|---|---|---|
matrix4 |
Float32Array | Model-View-Projection matrix (4x4). |
- Source:
dispose()
Disposes GPU resources owned by the material.
- Source:
setDiffuseTexture(texture, optionsopt)
Replaces the diffuse texture.
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
texture |
Texture2D | New texture instance. | |||||||||||
options |
Object |
<optional> |
Optional ownership configuration.
Properties
|
- Source: