Constructor
new MtlStandardMaterial(webglContext, optionsopt)
Creates a new MTL standard material.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
webglContext |
WebGL2RenderingContext | WebGL2 rendering context, used to compile the shaders. | |
options |
MtlStandardMaterialOptions |
<optional> |
Material options. |
Classes
Methods
(protected) applyAdditionalUniforms(worldMatrix, cameraPosition)
Uploads per-object uniforms specific to the standard material.
Parameters:
| Name | Type | Description |
|---|---|---|
worldMatrix |
Float32Array | World matrix. |
cameraPosition |
Float32Array | Camera position. |
dispose()
Disposes resources, owned by this material.
setAlphaMap(texture, optionsopt)
Sets an alpha texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Alpha texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setAmbientColor(color)
Sets the ambient color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Float32Array | Array.<number> | RGB color in [0..1] range. |
setAmbientMap(texture, optionsopt)
Sets an ambient texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Ambient texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setBumpMap(texture, optionsopt)
Sets a bump texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Bump texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setBumpMultiplier(value)
Sets bump multiplier value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Bump multiplier. |
setDiffuseMap(texture, optionsopt)
Sets a diffuse texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Diffuse texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setDisplacementMap(texture, optionsopt)
Sets a displacement texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Displacement texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setDisplacementScale(value)
Sets displacement scale.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Displacement scale factor. |
setEmissiveColor(color)
Sets the emissive color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Float32Array | Array.<number> | RGB color in [0..1] range. |
setOpticalDensity(value)
Sets optical density value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Optical density. |
setReflectionMap(texture, optionsopt)
Sets a reflection texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Reflection texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setShininess(value)
Sets the shininess exponent.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Shininess exponent. |
setSpecularColor(color)
Sets the specular color.
Parameters:
| Name | Type | Description |
|---|---|---|
color |
Float32Array | Array.<number> | RGB color in [0..1] range. |
setSpecularEnabled(enabled)
Enables or disables specular term.
Parameters:
| Name | Type | Description |
|---|---|---|
enabled |
boolean | Specular usage flag. |
setSpecularMap(texture, optionsopt)
Sets a specular texture and its UV-transform.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
texture |
Texture2D | Specular texture. | |
options |
MtlStandardMaterialMapOptions |
<optional> |
Map options. |
setSpecularStrength(value)
Sets the specular strength multiplier.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
number | Specular strength. |