Class: MtlStandardMaterial

MtlStandardMaterial(webglContext, optionsopt)

Material for MTL assets with multiple texture maps and Phong lighting.

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.
Source:

Classes

MtlStandardMaterial

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.
Source:

dispose()

Disposes resources, owned by this material.
Source:

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.
Source:

setAmbientColor(color)

Sets the ambient color.
Parameters:
Name Type Description
color Float32Array | Array.<number> RGB color in [0..1] range.
Source:

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.
Source:

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.
Source:

setBumpMultiplier(value)

Sets bump multiplier value.
Parameters:
Name Type Description
value number Bump multiplier.
Source:

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.
Source:

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.
Source:

setDisplacementScale(value)

Sets displacement scale.
Parameters:
Name Type Description
value number Displacement scale factor.
Source:

setEmissiveColor(color)

Sets the emissive color.
Parameters:
Name Type Description
color Float32Array | Array.<number> RGB color in [0..1] range.
Source:

setOpticalDensity(value)

Sets optical density value.
Parameters:
Name Type Description
value number Optical density.
Source:

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.
Source:

setShininess(value)

Sets the shininess exponent.
Parameters:
Name Type Description
value number Shininess exponent.
Source:

setSpecularColor(color)

Sets the specular color.
Parameters:
Name Type Description
color Float32Array | Array.<number> RGB color in [0..1] range.
Source:

setSpecularEnabled(enabled)

Enables or disables specular term.
Parameters:
Name Type Description
enabled boolean Specular usage flag.
Source:

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.
Source:

setSpecularStrength(value)

Sets the specular strength multiplier.
Parameters:
Name Type Description
value number Specular strength.
Source: