API Reference

Class List

StandardMaterial

Extends: Material

A Standard material is the main, general purpose material that is most often used for rendering. It can approximate a wide variety of surface types and can simulate dynamic reflected light. Most maps can use 3 types of input values in any combination: constant (color or number), mesh vertex colors and a texture. All enabled inputs are multiplied together.

// Create a new Standard material
const material = new pc.StandardMaterial();

// Update the material's diffuse and specular properties
material.diffuse.set(1, 0, 0);
material.specular.set(1, 1, 1);

// Notify the material that it has been modified
material.update();
// Create a new Standard material
const material = new pc.StandardMaterial();

// Assign a texture to the diffuse slot
material.diffuseMap = texture;

// Use the alpha channel of the texture for alpha testing with a reference value of 0.5
material.opacityMap = texture;
material.alphaTest = 0.5;

// Notify the material that it has been modified
material.update();

Summary

Properties

alphaFade

Used to fade out materials when StandardMaterial#opacityFadesSpecular is set to false.

ambient

The ambient color of the material.

ambientTint

Enables scene ambient multiplication by material ambient color.

anisotropy

Defines amount of anisotropy.

aoDetailMap

The detail (secondary) baked ambient occlusion (AO) map of the material (default is null).

aoDetailMapChannel

Color channels of the detail (secondary) AO map to use.

aoDetailMapOffset

Controls the 2D offset of the detail (secondary) AO map.

aoDetailMapRotation

Controls the 2D rotation (in degrees) of the detail (secondary) AO map.

aoDetailMapTiling

Controls the 2D tiling of the detail (secondary) AO map.

aoDetailMapUv

Detail (secondary) AO map UV channel.

aoDetailMode

Determines how the main (primary) and detail (secondary) AO maps are blended together.

aoMap

The main (primary) baked ambient occlusion (AO) map (default is null).

aoMapChannel

Color channel of the main (primary) AO map to use.

aoMapOffset

Controls the 2D offset of the main (primary) AO map.

aoMapRotation

Controls the 2D rotation (in degrees) of the main (primary) AO map.

aoMapTiling

Controls the 2D tiling of the main (primary) AO map.

aoMapUv

Main (primary) AO map UV channel

aoVertexColor

Use mesh vertex colors for AO.

aoVertexColorChannel

Vertex color channels to use for AO.

attenuation

The attenuation color for refractive materials, only used when useDynamicRefraction is enabled.

attenuationDistance

The distance defining the absorption rate of light within the medium.

bumpiness

The bumpiness of the material.

chunks

Object containing custom shader chunks that will replace default ones.

clearCoat

Defines intensity of clearcoat layer from 0 to 1.

clearCoatBumpiness

The bumpiness of the clearcoat layer.

clearCoatGloss

Defines the clearcoat glossiness of the clearcoat layer from 0 (rough) to 1 (mirror).

clearCoatGlossInvert

Invert the clearcoat gloss component (default is false).

clearCoatGlossMap

Monochrome clearcoat glossiness map (default is null).

clearCoatGlossMapChannel

Color channel of the clearcoat gloss map to use.

clearCoatGlossMapOffset

Controls the 2D offset of the clearcoat gloss map.

clearCoatGlossMapRotation

Controls the 2D rotation (in degrees) of the clear coat gloss map.

clearCoatGlossMapTiling

Controls the 2D tiling of the clearcoat gloss map.

clearCoatGlossMapUv

Clearcoat gloss map UV channel.

clearCoatGlossVertexColor

Use mesh vertex colors for clearcoat glossiness.

clearCoatGlossVertexColorChannel

Vertex color channel to use for clearcoat glossiness.

clearCoatMap

Monochrome clearcoat intensity map (default is null).

clearCoatMapChannel

Color channel of the clearcoat intensity map to use.

clearCoatMapOffset

Controls the 2D offset of the clearcoat intensity map.

clearCoatMapRotation

Controls the 2D rotation (in degrees) of the clearcoat intensity map.

clearCoatMapTiling

Controls the 2D tiling of the clearcoat intensity map.

clearCoatMapUv

Clearcoat intensity map UV channel.

clearCoatNormalMap

The clearcoat normal map of the material (default is null).

clearCoatNormalMapOffset

Controls the 2D offset of the main clearcoat normal map.

clearCoatNormalMapRotation

Controls the 2D rotation (in degrees) of the main clearcoat map.

clearCoatNormalMapTiling

Controls the 2D tiling of the main clearcoat normal map.

clearCoatNormalMapUv

Clearcoat normal map UV channel.

clearCoatVertexColor

Use mesh vertex colors for clearcoat intensity.

clearCoatVertexColorChannel

Vertex color channel to use for clearcoat intensity.

conserveEnergy

Defines how diffuse and specular components are combined when Fresnel is on.

cubeMap

The cubic environment map of the material (default is null).

cubeMapProjection

The type of projection applied to the cubeMap property:

  • CUBEPROJ_NONE: The cube map is treated as if it is infinitely far away.
cubeMapProjectionBox

The world space axis-aligned bounding box defining the box-projection used for the cubeMap property.

diffuse

The diffuse color of the material.

diffuseDetailMap

The detail (secondary) diffuse map of the material (default is null).

diffuseDetailMapChannel

Color channels of the detail (secondary) diffuse map to use.

diffuseDetailMapOffset

Controls the 2D offset of the detail (secondary) diffuse map.

diffuseDetailMapRotation

Controls the 2D rotation (in degrees) of the main (secondary) diffuse map.

diffuseDetailMapTiling

Controls the 2D tiling of the detail (secondary) diffuse map.

diffuseDetailMapUv

Detail (secondary) diffuse map UV channel.

diffuseDetailMode

Determines how the main (primary) and detail (secondary) diffuse maps are blended together.

diffuseMap

The main (primary) diffuse map of the material (default is null).

diffuseMapChannel

Color channels of the main (primary) diffuse map to use.

diffuseMapOffset

Controls the 2D offset of the main (primary) diffuse map.

diffuseMapRotation

Controls the 2D rotation (in degrees) of the main (primary) diffuse map.

diffuseMapTiling

Controls the 2D tiling of the main (primary) diffuse map.

diffuseMapUv

Main (primary) diffuse map UV channel.

diffuseTint

Multiply main (primary) diffuse map and/or diffuse vertex color by the constant diffuse value.

diffuseVertexColor

Use mesh vertex colors for diffuse.

diffuseVertexColorChannel

Vertex color channels to use for diffuse.

emissive

The emissive color of the material.

emissiveIntensity

Emissive color multiplier.

emissiveMap

The emissive map of the material (default is null).

emissiveMapChannel

Color channels of the emissive map to use.

emissiveMapOffset

Controls the 2D offset of the emissive map.

emissiveMapRotation

Controls the 2D rotation (in degrees) of the emissive map.

emissiveMapTiling

Controls the 2D tiling of the emissive map.

emissiveMapUv

Emissive map UV channel.

emissiveTint

Multiply emissive map and/or emissive vertex color by the constant emissive value.

emissiveVertexColor

Use mesh vertex colors for emission.

emissiveVertexColorChannel

Vertex color channels to use for emission.

enableGGXSpecular

Enables GGX specular.

envAtlas

The prefiltered environment lighting atlas (default is null).

fresnelModel

Defines the formula used for Fresnel effect.

gloss

Defines the glossiness of the material from 0 (rough) to 1 (shiny).

glossInvert

Invert the gloss component (default is false).

glossMap

Gloss map (default is null).

glossMapChannel

Color channel of the gloss map to use.

glossMapOffset

Controls the 2D offset of the gloss map.

glossMapRotation

Controls the 2D rotation (in degrees) of the gloss map.

glossMapTiling

Controls the 2D tiling of the gloss map.

glossMapUv

Gloss map UV channel.

glossVertexColor

Use mesh vertex colors for glossiness.

glossVertexColorChannel

Vertex color channel to use for glossiness.

heightMap

The height map of the material (default is null).

heightMapChannel

Color channel of the height map to use.

heightMapFactor

Height map multiplier.

heightMapOffset

Controls the 2D offset of the height map.

heightMapRotation

Controls the 2D rotation (in degrees) of the height map.

heightMapTiling

Controls the 2D tiling of the height map.

heightMapUv

Height map UV channel.

iridescenceMap

The per-pixel iridescence intensity.

iridescenceMapChannel

Color channels of the iridescence map to use.

iridescenceMapOffset

Controls the 2D offset of the iridescence map.

iridescenceMapRotation

Controls the 2D rotation (in degrees) of the iridescence map.

iridescenceMapTiling

Controls the 2D tiling of the iridescence map.

iridescenceMapUv

Iridescence map UV channel.

iridescenceRefractionIndex

The index of refraction of the iridescent thin-film.

iridescenceThicknessMap

The per-pixel iridescence thickness.

iridescenceThicknessMapChannel

Color channels of the iridescence thickness map to use.

iridescenceThicknessMapOffset

Controls the 2D offset of the iridescence thickness map.

iridescenceThicknessMapRotation

Controls the 2D rotation (in degrees) of the iridescence map.

iridescenceThicknessMapTiling

Controls the 2D tiling of the iridescence thickness map.

iridescenceThicknessMapUv

Iridescence thickness map UV channel.

iridescenceThicknessMax

The maximum thickness for the iridescence layer.

iridescenceThicknessMin

The minimum thickness for the iridescence layer.

lightMap

A custom lightmap of the material (default is null).

lightMapChannel

Color channels of the lightmap to use.

lightMapOffset

Controls the 2D offset of the lightmap.

lightMapRotation

Controls the 2D rotation (in degrees) of the lightmap.

lightMapTiling

Controls the 2D tiling of the lightmap.

lightMapUv

Lightmap UV channel

lightVertexColor

Use baked vertex lighting.

lightVertexColorChannel

Vertex color channels to use for baked lighting.

metalness

Defines how much the surface is metallic.

metalnessMap

Monochrome metalness map (default is null).

metalnessMapChannel

Color channel of the metalness map to use.

metalnessMapOffset

Controls the 2D offset of the metalness map.

metalnessMapRotation

Controls the 2D rotation (in degrees) of the metalness map.

metalnessMapTiling

Controls the 2D tiling of the metalness map.

metalnessMapUv

Metalness map UV channel.

metalnessVertexColor

Use mesh vertex colors for metalness.

metalnessVertexColorChannel

Vertex color channel to use for metalness.

normalDetailMap

The detail (secondary) normal map of the material (default is null).

normalDetailMapBumpiness

The bumpiness of the material.

normalDetailMapOffset

Controls the 2D offset of the detail (secondary) normal map.

normalDetailMapRotation

Controls the 2D rotation (in degrees) of the detail (secondary) normal map.

normalDetailMapTiling

Controls the 2D tiling of the detail (secondary) normal map.

normalDetailMapUv

Detail (secondary) normal map UV channel.

normalMap

The main (primary) normal map of the material (default is null).

normalMapOffset

Controls the 2D offset of the main (primary) normal map.

normalMapRotation

Controls the 2D rotation (in degrees) of the main (primary) normal map.

normalMapTiling

Controls the 2D tiling of the main (primary) normal map.

normalMapUv

Main (primary) normal map UV channel.

occludeDirect

Tells if AO should darken directional lighting.

occludeSpecular

Uses ambient occlusion to darken specular/reflection.

occludeSpecularIntensity

Controls visibility of specular occlusion.

onUpdateShader

A custom function that will be called after all shader generator properties are collected and before shader code is generated.

opacity

The opacity of the material.

opacityFadesSpecular

Used to specify whether specular and reflections are faded out using StandardMaterial#opacity.

opacityMap

The opacity map of the material (default is null).

opacityMapChannel

Color channel of the opacity map to use.

opacityMapOffset

Controls the 2D offset of the opacity map.

opacityMapRotation

Controls the 2D rotation (in degrees) of the opacity map.

opacityMapTiling

Controls the 2D tiling of the opacity map.

opacityMapUv

Opacity map UV channel.

opacityVertexColor

Use mesh vertex colors for opacity.

opacityVertexColorChannel

Vertex color channels to use for opacity.

pixelSnap

Align vertices to pixel coordinates when rendering.

reflectivity

Environment map intensity.

refraction

Defines the visibility of refraction.

refractionIndex

Defines the index of refraction, i.

refractionMap

The map of the refraction visibility.

refractionMapChannel

Color channels of the refraction map to use.

refractionMapOffset

Controls the 2D offset of the refraction map.

refractionMapRotation

Controls the 2D rotation (in degrees) of the emissive map.

refractionMapTiling

Controls the 2D tiling of the refraction map.

refractionMapUv

Refraction map UV channel.

refractionVertexColor

Use mesh vertex colors for refraction.

refractionVertexColorChannel

Vertex color channel to use for refraction.

shadingModel

Defines the shading model.

sheen

The specular color of the sheen (fabric) microfiber structure.

sheenGloss

The glossiness of the sheen (fabric) microfiber structure.

sheenGlossInvert

Invert the sheen gloss component (default is false).

sheenGlossMap

The sheen glossiness microstructure color map of the material (default is null).

sheenGlossMapChannel

Color channels of the sheen glossiness map to use.

sheenGlossMapOffset

Controls the 2D offset of the sheen glossiness map.

sheenGlossMapRotation

Controls the 2D rotation (in degrees) of the sheen glossiness map.

sheenGlossMapTiling

Controls the 2D tiling of the sheen glossiness map.

sheenGlossMapUv

Sheen map UV channel.

sheenGlossTint

Multiply sheen glossiness map and/or sheen glossiness vertex value by the scalar sheen glossiness value.

sheenGlossVertexColor

Use mesh vertex colors for sheen glossiness.

sheenGlossVertexColorChannel

Vertex color channels to use for sheen glossiness.

sheenMap

The sheen microstructure color map of the material (default is null).

sheenMapChannel

Color channels of the sheen map to use.

sheenMapOffset

Controls the 2D offset of the sheen map.

sheenMapRotation

Controls the 2D rotation (in degrees) of the sheen map.

sheenMapTiling

Controls the 2D tiling of the sheen map.

sheenMapUv

Sheen map UV channel.

sheenTint

Multiply sheen map and/or sheen vertex color by the constant sheen value.

sheenVertexColor

Use mesh vertex colors for sheen.

specular

The specular color of the material.

specularityFactor

The factor of specular intensity, used to weight the fresnel and specularity.

specularityFactorMap

The factor of specularity as a texture (default is null).

specularityFactorMapChannel

The channel used by the specularity factor texture to sample from (default is 'a').

specularityFactorMapOffset

Controls the 2D offset of the specularity factor map.

specularityFactorMapRotation

Controls the 2D rotation (in degrees) of the specularity factor map.

specularityFactorMapTiling

Controls the 2D tiling of the specularity factor map.

specularityFactorMapUv

Specularity factor map UV channel.

specularityFactorTint

Multiply specularity factor map and/or specular vertex color by the constant specular value.

specularityFactorVertexColor

Use mesh vertex colors for specularity factor.

specularityFactorVertexColorChannel

Vertex color channels to use for specularity factor.

specularMap

The specular map of the material (default is null).

specularMapChannel

Color channels of the specular map to use.

specularMapOffset

Controls the 2D offset of the specular map.

specularMapRotation

Controls the 2D rotation (in degrees) of the specular map.

specularMapTiling

Controls the 2D tiling of the specular map.

specularMapUv

Specular map UV channel.

specularTint

Multiply specular map and/or specular vertex color by the constant specular value.

specularVertexColor

Use mesh vertex colors for specular.

specularVertexColorChannel

Vertex color channels to use for specular.

sphereMap

The spherical environment map of the material (default is null).

thickness

The thickness of the medium, only used when useDynamicRefraction is enabled.

thicknessMap

The per-pixel thickness of the medium, only used when useDynamicRefraction is enabled.

thicknessMapChannel

Color channels of the thickness map to use.

thicknessMapOffset

Controls the 2D offset of the thickness map.

thicknessMapRotation

Controls the 2D rotation (in degrees) of the thickness map.

thicknessMapTiling

Controls the 2D tiling of the thickness map.

thicknessMapUv

Thickness map UV channel.

thicknessVertexColor

Use mesh vertex colors for thickness.

twoSidedLighting

Calculate proper normals (and therefore lighting) on backfaces.

useDynamicRefraction

Enables higher quality refractions using the grab pass instead of pre-computed cube maps for refractions.

useFog

Apply fogging (as configured in scene settings)

useGammaTonemap

Apply gamma correction and tonemapping (as configured in scene settings).

useIridescence

Enable thin-film iridescence.

useLighting

Apply lighting

useMetalness

Use metalness properties instead of specular.

useMetalnessSpecularColor

When metalness is enabled, use the specular map to apply color tint to specular reflections.

useSheen

Toggle sheen specular effect on/off.

useSkybox

Apply scene skybox as prefiltered environment map

Methods

copy

Copy a StandardMaterial.

destroy

Removes this material from the scene and possibly frees up memory from its shaders (if there are no other materials using it).

setAttribute

Sets a vertex shader attribute on a material.

Inherited

Properties

alphaTest

The alpha test reference value to control which fragments are written to the currently active render target based on alpha value.

alphaToCoverage

Enables or disables alpha to coverage (WebGL2 only).

alphaWrite

If true, the alpha component of fragments generated by the shader of this material is written to the color buffer of the currently active render target.

blendState

Controls how fragment shader outputs are blended when being written to the currently active render target.

blendType

Controls how fragment shader outputs are blended when being written to the currently active render target.

blueWrite

If true, the blue component of fragments generated by the shader of this material is written to the color buffer of the currently active render target.

cull

Controls how triangles are culled based on their face direction with respect to the viewpoint.

depthBias

Offsets the output depth buffer value.

depthFunc

Controls how the depth of new fragments is compared against the current depth contained in the depth buffer.

depthState

Sets the depth state.

depthTest

If true, fragments generated by the shader of this material are only written to the current render target if they pass the depth test.

depthWrite

If true, fragments generated by the shader of this material write a depth value to the depth buffer of the currently active render target.

greenWrite

If true, the green component of fragments generated by the shader of this material is written to the color buffer of the currently active render target.

name

The name of the material.

redWrite

If true, the red component of fragments generated by the shader of this material is written to the color buffer of the currently active render target.

shader

The shader used by this material to render mesh instances (default is null).

slopeDepthBias

Same as Material#depthBias, but also depends on the slope of the triangle relative to the camera.

stencilBack

Stencil parameters for back faces (default is null).

stencilFront

Stencil parameters for front faces (default is null).

userId

A unique id the user can assign to the material.

Methods

clone

Clone a material.

deleteParameter

Deletes a shader parameter on a material.

getParameter

Retrieves the specified shader parameter from a material.

setParameter

Sets a shader parameter on a material.

update

Applies any changes made to the material's properties.

Details

Constructor

StandardMaterial()

Create a new StandardMaterial instance.

// Create a new Standard material
const material = new pc.StandardMaterial();

// Update the material's diffuse and specular properties
material.diffuse.set(1, 0, 0);
material.specular.set(1, 1, 1);

// Notify the material that it has been modified
material.update();
// Create a new Standard material
const material = new pc.StandardMaterial();

// Assign a texture to the diffuse slot
material.diffuseMap = texture;

// Use the alpha channel of the texture for alpha testing with a reference value of 0.5
material.opacityMap = texture;
material.alphaTest = 0.5;

// Notify the material that it has been modified
material.update();

Properties

numberalphaFade

Used to fade out materials when StandardMaterial#opacityFadesSpecular is set to false.

Colorambient

The ambient color of the material. This color value is 3-component (RGB), where each component is between 0 and 1.

booleanambientTint

Enables scene ambient multiplication by material ambient color.

numberanisotropy

Defines amount of anisotropy. Requires StandardMaterial#enableGGXSpecular is set to true.

  • When anisotropy == 0, specular is isotropic.
  • When anisotropy < 0, anisotropy direction aligns with the tangent, and specular anisotropy increases as the anisotropy value decreases to minimum of -1.
  • When anisotropy > 0, anisotropy direction aligns with the bi-normal, and specular anisotropy increases as anisotropy value increases to maximum of 1.

Texture, nullaoDetailMap

The detail (secondary) baked ambient occlusion (AO) map of the material (default is null). Will only be used if main (primary) ao map is non-null.

stringaoDetailMapChannel

Color channels of the detail (secondary) AO map to use. Can be "r", "g", "b" or "a" (default is "g").

Vec2aoDetailMapOffset

Controls the 2D offset of the detail (secondary) AO map. Each component is between 0 and 1.

numberaoDetailMapRotation

Controls the 2D rotation (in degrees) of the detail (secondary) AO map.

Vec2aoDetailMapTiling

Controls the 2D tiling of the detail (secondary) AO map.

numberaoDetailMapUv

Detail (secondary) AO map UV channel.

stringaoDetailMode

Determines how the main (primary) and detail (secondary) AO maps are blended together. Can be:

Defaults to DETAILMODE_MUL.

Texture, nullaoMap

The main (primary) baked ambient occlusion (AO) map (default is null). Modulates ambient color.

stringaoMapChannel

Color channel of the main (primary) AO map to use. Can be "r", "g", "b" or "a".

Vec2aoMapOffset

Controls the 2D offset of the main (primary) AO map. Each component is between 0 and 1.

numberaoMapRotation

Controls the 2D rotation (in degrees) of the main (primary) AO map.

Vec2aoMapTiling

Controls the 2D tiling of the main (primary) AO map.

numberaoMapUv

Main (primary) AO map UV channel

booleanaoVertexColor

Use mesh vertex colors for AO. If aoMap is set, it'll be multiplied by vertex colors.

stringaoVertexColorChannel

Vertex color channels to use for AO. Can be "r", "g", "b" or "a".

Colorattenuation

The attenuation color for refractive materials, only used when useDynamicRefraction is enabled.

numberattenuationDistance

The distance defining the absorption rate of light within the medium. Only used when useDynamicRefraction is enabled.

numberbumpiness

The bumpiness of the material. This value scales the assigned main (primary) normal map. It should be normally between 0 (no bump mapping) and 1 (full bump mapping), but can be set to e.g. 2 to give even more pronounced bump effect.

{ [string]: string }chunks

Object containing custom shader chunks that will replace default ones.

numberclearCoat

Defines intensity of clearcoat layer from 0 to 1. Clearcoat layer is disabled when clearCoat == 0. Default value is 0 (disabled).

numberclearCoatBumpiness

The bumpiness of the clearcoat layer. This value scales the assigned main clearcoat normal map. It should be normally between 0 (no bump mapping) and 1 (full bump mapping), but can be set to e.g. 2 to give even more pronounced bump effect.

numberclearCoatGloss

Defines the clearcoat glossiness of the clearcoat layer from 0 (rough) to 1 (mirror).

booleanclearCoatGlossInvert

Invert the clearcoat gloss component (default is false). Enabling this flag results in material treating the clear coat gloss members as roughness.

Texture, nullclearCoatGlossMap

Monochrome clearcoat glossiness map (default is null). If specified, will be multiplied by normalized 'clearCoatGloss' value and/or vertex colors.

stringclearCoatGlossMapChannel

Color channel of the clearcoat gloss map to use. Can be "r", "g", "b" or "a".

Vec2clearCoatGlossMapOffset

Controls the 2D offset of the clearcoat gloss map. Each component is between 0 and 1.

numberclearCoatGlossMapRotation

Controls the 2D rotation (in degrees) of the clear coat gloss map.

Vec2clearCoatGlossMapTiling

Controls the 2D tiling of the clearcoat gloss map.

numberclearCoatGlossMapUv

Clearcoat gloss map UV channel.

booleanclearCoatGlossVertexColor

Use mesh vertex colors for clearcoat glossiness. If clearCoatGlossMap is set, it'll be multiplied by vertex colors.

stringclearCoatGlossVertexColorChannel

Vertex color channel to use for clearcoat glossiness. Can be "r", "g", "b" or "a".

Texture, nullclearCoatMap

Monochrome clearcoat intensity map (default is null). If specified, will be multiplied by normalized 'clearCoat' value and/or vertex colors.

stringclearCoatMapChannel

Color channel of the clearcoat intensity map to use. Can be "r", "g", "b" or "a".

Vec2clearCoatMapOffset

Controls the 2D offset of the clearcoat intensity map. Each component is between 0 and 1.

numberclearCoatMapRotation

Controls the 2D rotation (in degrees) of the clearcoat intensity map.

Vec2clearCoatMapTiling

Controls the 2D tiling of the clearcoat intensity map.

numberclearCoatMapUv

Clearcoat intensity map UV channel.

Texture, nullclearCoatNormalMap

The clearcoat normal map of the material (default is null). The texture must contains normalized, tangent space normals.

Vec2clearCoatNormalMapOffset

Controls the 2D offset of the main clearcoat normal map. Each component is between 0 and 1.

numberclearCoatNormalMapRotation

Controls the 2D rotation (in degrees) of the main clearcoat map.

Vec2clearCoatNormalMapTiling

Controls the 2D tiling of the main clearcoat normal map.

numberclearCoatNormalMapUv

Clearcoat normal map UV channel.

booleanclearCoatVertexColor

Use mesh vertex colors for clearcoat intensity. If clearCoatMap is set, it'll be multiplied by vertex colors.

stringclearCoatVertexColorChannel

Vertex color channel to use for clearcoat intensity. Can be "r", "g", "b" or "a".

booleanconserveEnergy

Defines how diffuse and specular components are combined when Fresnel is on. It is recommended that you leave this option enabled, although you may want to disable it in case when all reflection comes only from a few light sources, and you don't use an environment map, therefore having mostly black reflection.

Texture, nullcubeMap

The cubic environment map of the material (default is null). This setting overrides sphereMap and will replace the scene lighting environment.

numbercubeMapProjection

The type of projection applied to the cubeMap property:

BoundingBoxcubeMapProjectionBox

The world space axis-aligned bounding box defining the box-projection used for the cubeMap property. Only used when cubeMapProjection is set to CUBEPROJ_BOX.

Colordiffuse

The diffuse color of the material. This color value is 3-component (RGB), where each component is between 0 and 1. Defines basic surface color (aka albedo).

Texture, nulldiffuseDetailMap

The detail (secondary) diffuse map of the material (default is null). Will only be used if main (primary) diffuse map is non-null.

stringdiffuseDetailMapChannel

Color channels of the detail (secondary) diffuse map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2diffuseDetailMapOffset

Controls the 2D offset of the detail (secondary) diffuse map. Each component is between 0 and 1.

numberdiffuseDetailMapRotation

Controls the 2D rotation (in degrees) of the main (secondary) diffuse map.

Vec2diffuseDetailMapTiling

Controls the 2D tiling of the detail (secondary) diffuse map.

numberdiffuseDetailMapUv

Detail (secondary) diffuse map UV channel.

stringdiffuseDetailMode

Determines how the main (primary) and detail (secondary) diffuse maps are blended together. Can be:

Defaults to DETAILMODE_MUL.

Texture, nulldiffuseMap

The main (primary) diffuse map of the material (default is null).

stringdiffuseMapChannel

Color channels of the main (primary) diffuse map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2diffuseMapOffset

Controls the 2D offset of the main (primary) diffuse map. Each component is between 0 and 1.

numberdiffuseMapRotation

Controls the 2D rotation (in degrees) of the main (primary) diffuse map.

Vec2diffuseMapTiling

Controls the 2D tiling of the main (primary) diffuse map.

numberdiffuseMapUv

Main (primary) diffuse map UV channel.

booleandiffuseTint

Multiply main (primary) diffuse map and/or diffuse vertex color by the constant diffuse value.

booleandiffuseVertexColor

Use mesh vertex colors for diffuse. If diffuseMap or are diffuseTint are set, they'll be multiplied by vertex colors.

stringdiffuseVertexColorChannel

Vertex color channels to use for diffuse. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Coloremissive

The emissive color of the material. This color value is 3-component (RGB), where each component is between 0 and 1.

numberemissiveIntensity

Emissive color multiplier.

Texture, nullemissiveMap

The emissive map of the material (default is null). Can be HDR.

stringemissiveMapChannel

Color channels of the emissive map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2emissiveMapOffset

Controls the 2D offset of the emissive map. Each component is between 0 and 1.

numberemissiveMapRotation

Controls the 2D rotation (in degrees) of the emissive map.

Vec2emissiveMapTiling

Controls the 2D tiling of the emissive map.

numberemissiveMapUv

Emissive map UV channel.

booleanemissiveTint

Multiply emissive map and/or emissive vertex color by the constant emissive value.

booleanemissiveVertexColor

Use mesh vertex colors for emission. If emissiveMap or emissiveTint are set, they'll be multiplied by vertex colors.

stringemissiveVertexColorChannel

Vertex color channels to use for emission. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

booleanenableGGXSpecular

Enables GGX specular. Also enables StandardMaterial#anisotropy parameter to set material anisotropy.

Texture, nullenvAtlas

The prefiltered environment lighting atlas (default is null). This setting overrides cubeMap and sphereMap and will replace the scene lighting environment.

numberfresnelModel

Defines the formula used for Fresnel effect. As a side-effect, enabling any Fresnel model changes the way diffuse and reflection components are combined. When Fresnel is off, legacy non energy-conserving combining is used. When it is on, combining behavior is defined by conserveEnergy parameter.

numbergloss

Defines the glossiness of the material from 0 (rough) to 1 (shiny).

booleanglossInvert

Invert the gloss component (default is false). Enabling this flag results in material treating the gloss members as roughness.

Texture, nullglossMap

Gloss map (default is null). If specified, will be multiplied by normalized gloss value and/or vertex colors.

stringglossMapChannel

Color channel of the gloss map to use. Can be "r", "g", "b" or "a".

Vec2glossMapOffset

Controls the 2D offset of the gloss map. Each component is between 0 and 1.

numberglossMapRotation

Controls the 2D rotation (in degrees) of the gloss map.

Vec2glossMapTiling

Controls the 2D tiling of the gloss map.

numberglossMapUv

Gloss map UV channel.

booleanglossVertexColor

Use mesh vertex colors for glossiness. If glossMap is set, it'll be multiplied by vertex colors.

stringglossVertexColorChannel

Vertex color channel to use for glossiness. Can be "r", "g", "b" or "a".

Texture, nullheightMap

The height map of the material (default is null). Used for a view-dependent parallax effect. The texture must represent the height of the surface where darker pixels are lower and lighter pixels are higher. It is recommended to use it together with a normal map.

stringheightMapChannel

Color channel of the height map to use. Can be "r", "g", "b" or "a".

numberheightMapFactor

Height map multiplier. Affects the strength of the parallax effect.

Vec2heightMapOffset

Controls the 2D offset of the height map. Each component is between 0 and 1.

numberheightMapRotation

Controls the 2D rotation (in degrees) of the height map.

Vec2heightMapTiling

Controls the 2D tiling of the height map.

numberheightMapUv

Height map UV channel.

Texture, nulliridescenceMap

The per-pixel iridescence intensity. Only used when useIridescence is enabled.

stringiridescenceMapChannel

Color channels of the iridescence map to use. Can be "r", "g", "b" or "a".

Vec2iridescenceMapOffset

Controls the 2D offset of the iridescence map. Each component is between 0 and 1.

numberiridescenceMapRotation

Controls the 2D rotation (in degrees) of the iridescence map.

Vec2iridescenceMapTiling

Controls the 2D tiling of the iridescence map.

numberiridescenceMapUv

Iridescence map UV channel.

numberiridescenceRefractionIndex

The index of refraction of the iridescent thin-film. Affects the color phase shift as described here: https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_iridescence

Texture, nulliridescenceThicknessMap

The per-pixel iridescence thickness. Defines a gradient weight between iridescenceThicknessMin and iridescenceThicknessMax. Only used when useIridescence is enabled.

stringiridescenceThicknessMapChannel

Color channels of the iridescence thickness map to use. Can be "r", "g", "b" or "a".

Vec2iridescenceThicknessMapOffset

Controls the 2D offset of the iridescence thickness map. Each component is between 0 and 1.

numberiridescenceThicknessMapRotation

Controls the 2D rotation (in degrees) of the iridescence map.

Vec2iridescenceThicknessMapTiling

Controls the 2D tiling of the iridescence thickness map.

numberiridescenceThicknessMapUv

Iridescence thickness map UV channel.

numberiridescenceThicknessMax

The maximum thickness for the iridescence layer. Used as the 'base' thickness when no iridescence thickness map is defined. The unit is in nm.

numberiridescenceThicknessMin

The minimum thickness for the iridescence layer. Only used when an iridescence thickness map is used. The unit is in nm.

Texture, nulllightMap

A custom lightmap of the material (default is null). Lightmaps are textures that contain pre-rendered lighting. Can be HDR.

stringlightMapChannel

Color channels of the lightmap to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2lightMapOffset

Controls the 2D offset of the lightmap. Each component is between 0 and 1.

numberlightMapRotation

Controls the 2D rotation (in degrees) of the lightmap.

Vec2lightMapTiling

Controls the 2D tiling of the lightmap.

numberlightMapUv

Lightmap UV channel

booleanlightVertexColor

Use baked vertex lighting. If lightMap is set, it'll be multiplied by vertex colors.

stringlightVertexColorChannel

Vertex color channels to use for baked lighting. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

numbermetalness

Defines how much the surface is metallic. From 0 (dielectric) to 1 (metal).

Texture, nullmetalnessMap

Monochrome metalness map (default is null).

stringmetalnessMapChannel

Color channel of the metalness map to use. Can be "r", "g", "b" or "a".

Vec2metalnessMapOffset

Controls the 2D offset of the metalness map. Each component is between 0 and 1.

numbermetalnessMapRotation

Controls the 2D rotation (in degrees) of the metalness map.

Vec2metalnessMapTiling

Controls the 2D tiling of the metalness map.

numbermetalnessMapUv

Metalness map UV channel.

booleanmetalnessVertexColor

Use mesh vertex colors for metalness. If metalnessMap is set, it'll be multiplied by vertex colors.

stringmetalnessVertexColorChannel

Vertex color channel to use for metalness. Can be "r", "g", "b" or "a".

Texture, nullnormalDetailMap

The detail (secondary) normal map of the material (default is null). Will only be used if main (primary) normal map is non-null.

numbernormalDetailMapBumpiness

The bumpiness of the material. This value scales the assigned detail (secondary) normal map. It should be normally between 0 (no bump mapping) and 1 (full bump mapping), but can be set to e.g. 2 to give even more pronounced bump effect.

Vec2normalDetailMapOffset

Controls the 2D offset of the detail (secondary) normal map. Each component is between 0 and 1.

numbernormalDetailMapRotation

Controls the 2D rotation (in degrees) of the detail (secondary) normal map.

Vec2normalDetailMapTiling

Controls the 2D tiling of the detail (secondary) normal map.

numbernormalDetailMapUv

Detail (secondary) normal map UV channel.

Texture, nullnormalMap

The main (primary) normal map of the material (default is null). The texture must contains normalized, tangent space normals.

Vec2normalMapOffset

Controls the 2D offset of the main (primary) normal map. Each component is between 0 and 1.

numbernormalMapRotation

Controls the 2D rotation (in degrees) of the main (primary) normal map.

Vec2normalMapTiling

Controls the 2D tiling of the main (primary) normal map.

numbernormalMapUv

Main (primary) normal map UV channel.

booleanoccludeDirect

Tells if AO should darken directional lighting. Defaults to false.

numberoccludeSpecular

Uses ambient occlusion to darken specular/reflection. It's a hack, because real specular occlusion is view-dependent. However, it can be better than nothing.

numberoccludeSpecularIntensity

Controls visibility of specular occlusion.

UpdateShaderCallbackonUpdateShader

A custom function that will be called after all shader generator properties are collected and before shader code is generated. This function will receive an object with shader generator settings (based on current material and scene properties), that you can change and then return. Returned value will be used instead. This is mostly useful when rendering the same set of objects, but with different shader variations based on the same material. For example, you may wish to render a depth or normal pass using textures assigned to the material, a reflection pass with simpler shaders and so on. These properties are split into two sections, generic standard material options and lit options. Properties of the standard material options are StandardMaterialOptions and the options for the lit options are LitShaderOptions.

numberopacity

The opacity of the material. This value can be between 0 and 1, where 0 is fully transparent and 1 is fully opaque. If you want the material to be semi-transparent you also need to set the Material#blendType to BLEND_NORMAL, BLEND_ADDITIVE or any other mode. Also note that for most semi-transparent objects you want Material#depthWrite to be false, otherwise they can fully occlude objects behind them.

booleanopacityFadesSpecular

Used to specify whether specular and reflections are faded out using StandardMaterial#opacity. Default is true. When set to false use Material#alphaFade to fade out materials.

Texture, nullopacityMap

The opacity map of the material (default is null).

stringopacityMapChannel

Color channel of the opacity map to use. Can be "r", "g", "b" or "a".

Vec2opacityMapOffset

Controls the 2D offset of the opacity map. Each component is between 0 and 1.

numberopacityMapRotation

Controls the 2D rotation (in degrees) of the opacity map.

Vec2opacityMapTiling

Controls the 2D tiling of the opacity map.

numberopacityMapUv

Opacity map UV channel.

booleanopacityVertexColor

Use mesh vertex colors for opacity. If opacityMap is set, it'll be multiplied by vertex colors.

stringopacityVertexColorChannel

Vertex color channels to use for opacity. Can be "r", "g", "b" or "a".

booleanpixelSnap

Align vertices to pixel coordinates when rendering. Useful for pixel perfect 2D graphics.

numberreflectivity

Environment map intensity.

numberrefraction

Defines the visibility of refraction. Material can refract the same cube map as used for reflections.

numberrefractionIndex

Defines the index of refraction, i.e. The amount of distortion. The value is calculated as (outerIor / surfaceIor), where inputs are measured indices of refraction, the one around the object and the one of its own surface. In most situations outer medium is air, so outerIor will be approximately 1. Then you only need to do (1.0 / surfaceIor).

Texture, nullrefractionMap

The map of the refraction visibility.

stringrefractionMapChannel

Color channels of the refraction map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2refractionMapOffset

Controls the 2D offset of the refraction map. Each component is between 0 and 1.

numberrefractionMapRotation

Controls the 2D rotation (in degrees) of the emissive map.

Vec2refractionMapTiling

Controls the 2D tiling of the refraction map.

numberrefractionMapUv

Refraction map UV channel.

booleanrefractionVertexColor

Use mesh vertex colors for refraction. If refraction map is set, it will be be multiplied by vertex colors.

booleanrefractionVertexColorChannel

Vertex color channel to use for refraction. Can be "r", "g", "b" or "a".

numbershadingModel

Defines the shading model.

  • SPECULAR_PHONG: Phong without energy conservation. You should only use it as a backwards compatibility with older projects.
  • SPECULAR_BLINN: Energy-conserving Blinn-Phong.

Colorsheen

The specular color of the sheen (fabric) microfiber structure. This color value is 3-component (RGB), where each component is between 0 and 1.

numbersheenGloss

The glossiness of the sheen (fabric) microfiber structure. This color value is a single value between 0 and 1.

booleansheenGlossInvert

Invert the sheen gloss component (default is false). Enabling this flag results in material treating the sheen gloss members as roughness.

Texture, nullsheenGlossMap

The sheen glossiness microstructure color map of the material (default is null).

stringsheenGlossMapChannel

Color channels of the sheen glossiness map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2sheenGlossMapOffset

Controls the 2D offset of the sheen glossiness map. Each component is between 0 and 1.

numbersheenGlossMapRotation

Controls the 2D rotation (in degrees) of the sheen glossiness map.

Vec2sheenGlossMapTiling

Controls the 2D tiling of the sheen glossiness map.

numbersheenGlossMapUv

Sheen map UV channel.

booleansheenGlossTint

Multiply sheen glossiness map and/or sheen glossiness vertex value by the scalar sheen glossiness value.

booleansheenGlossVertexColor

Use mesh vertex colors for sheen glossiness. If sheen glossiness map or sheen glossiness tint are set, they'll be multiplied by vertex colors.

stringsheenGlossVertexColorChannel

Vertex color channels to use for sheen glossiness. Can be "r", "g", "b" or "a".

Texture, nullsheenMap

The sheen microstructure color map of the material (default is null).

stringsheenMapChannel

Color channels of the sheen map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2sheenMapOffset

Controls the 2D offset of the sheen map. Each component is between 0 and 1.

numbersheenMapRotation

Controls the 2D rotation (in degrees) of the sheen map.

Vec2sheenMapTiling

Controls the 2D tiling of the sheen map.

numbersheenMapUv

Sheen map UV channel.

booleansheenTint

Multiply sheen map and/or sheen vertex color by the constant sheen value.

booleansheenVertexColor

Use mesh vertex colors for sheen. If sheen map or sheen tint are set, they'll be multiplied by vertex colors.

Colorspecular

The specular color of the material. This color value is 3-component (RGB), where each component is between 0 and 1. Defines surface reflection/specular color. Affects specular intensity and tint.

numberspecularityFactor

The factor of specular intensity, used to weight the fresnel and specularity. Default is 1.0.

Texture, nullspecularityFactorMap

The factor of specularity as a texture (default is null).

stringspecularityFactorMapChannel

The channel used by the specularity factor texture to sample from (default is 'a').

Vec2specularityFactorMapOffset

Controls the 2D offset of the specularity factor map. Each component is between 0 and 1.

numberspecularityFactorMapRotation

Controls the 2D rotation (in degrees) of the specularity factor map.

Vec2specularityFactorMapTiling

Controls the 2D tiling of the specularity factor map.

numberspecularityFactorMapUv

Specularity factor map UV channel.

booleanspecularityFactorTint

Multiply specularity factor map and/or specular vertex color by the constant specular value. "r", "g", "b", "a", "rgb" or any swizzled combination.

booleanspecularityFactorVertexColor

Use mesh vertex colors for specularity factor. If specularityFactorMap or are specularityFactorTint are set, they'll be multiplied by vertex colors.

stringspecularityFactorVertexColorChannel

Vertex color channels to use for specularity factor. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Texture, nullspecularMap

The specular map of the material (default is null).

stringspecularMapChannel

Color channels of the specular map to use. Can be "r", "g", "b", "a", "rgb" or any swizzled combination.

Vec2specularMapOffset

Controls the 2D offset of the specular map. Each component is between 0 and 1.

numberspecularMapRotation

Controls the 2D rotation (in degrees) of the specular map.

Vec2specularMapTiling

Controls the 2D tiling of the specular map.

numberspecularMapUv

Specular map UV channel.

booleanspecularTint

Multiply specular map and/or specular vertex color by the constant specular value.

booleanspecularVertexColor

Use mesh vertex colors for specular. If specularMap or are specularTint are set, they'll be multiplied by vertex colors.

stringspecularVertexColorChannel

Vertex color channels to use for specular. Can be

Texture, nullsphereMap

The spherical environment map of the material (default is null). This will replace the scene lighting environment.

numberthickness

The thickness of the medium, only used when useDynamicRefraction is enabled. The unit is in base units, and scales with the size of the object.

Texture, nullthicknessMap

The per-pixel thickness of the medium, only used when useDynamicRefraction is enabled.

stringthicknessMapChannel

Color channels of the thickness map to use. Can be "r", "g", "b" or "a".

Vec2thicknessMapOffset

Controls the 2D offset of the thickness map. Each component is between 0 and 1.

numberthicknessMapRotation

Controls the 2D rotation (in degrees) of the thickness map.

Vec2thicknessMapTiling

Controls the 2D tiling of the thickness map.

numberthicknessMapUv

Thickness map UV channel.

booleanthicknessVertexColor

Use mesh vertex colors for thickness. If thickness map is set, it will be be multiplied by vertex colors.

booleantwoSidedLighting

Calculate proper normals (and therefore lighting) on backfaces.

booleanuseDynamicRefraction

Enables higher quality refractions using the grab pass instead of pre-computed cube maps for refractions.

booleanuseFog

Apply fogging (as configured in scene settings)

booleanuseGammaTonemap

Apply gamma correction and tonemapping (as configured in scene settings).

booleanuseIridescence

Enable thin-film iridescence.

booleanuseLighting

Apply lighting

booleanuseMetalness

Use metalness properties instead of specular. When enabled, diffuse colors also affect specular instead of the dedicated specular map. This can be used as alternative to specular color to save space. With metalness == 0, the pixel is assumed to be dielectric, and diffuse color is used as normal. With metalness == 1, the pixel is fully metallic, and diffuse color is used as specular color instead.

booleanuseMetalnessSpecularColor

When metalness is enabled, use the specular map to apply color tint to specular reflections. at direct angles.

booleanuseSheen

Toggle sheen specular effect on/off.

booleanuseSkybox

Apply scene skybox as prefiltered environment map

Methods

copy(source)

Copy a StandardMaterial.

Parameters

sourceStandardMaterial

The material to copy from.

Returns

StandardMaterial

The destination material.

destroy()

Removes this material from the scene and possibly frees up memory from its shaders (if there are no other materials using it).

setAttribute(name, semantic)

Sets a vertex shader attribute on a material.

mesh.setVertexStream(pc.SEMANTIC_ATTR15, offset, 3);
material.setAttribute('offset', pc.SEMANTIC_ATTR15);

Parameters

namestring

The name of the parameter to set.

semanticstring

Semantic to map the vertex data. Must match with the semantic set on vertex stream of the mesh.

Inherited

Properties

numberalphaTest

The alpha test reference value to control which fragments are written to the currently active render target based on alpha value. All fragments with an alpha value of less than the alphaTest reference value will be discarded. alphaTest defaults to 0 (all fragments pass).

booleanalphaToCoverage

Enables or disables alpha to coverage (WebGL2 only). When enabled, and if hardware anti-aliasing is on, limited order-independent transparency can be achieved. Quality depends on the number of MSAA samples of the current render target. It can nicely soften edges of otherwise sharp alpha cutouts, but isn't recommended for large area semi-transparent surfaces. Note, that you don't need to enable blending to make alpha to coverage work. It will work without it, just like alphaTest.

booleanalphaWrite

If true, the alpha component of fragments generated by the shader of this material is written to the color buffer of the currently active render target. If false, the alpha component will not be written. Defaults to true.

BlendStateblendState

Controls how fragment shader outputs are blended when being written to the currently active render target. This overwrites blending type set using Material#blendType, and offers more control over blending.

numberblendType

Controls how fragment shader outputs are blended when being written to the currently active render target. Can be:

Defaults to BLEND_NONE.

booleanblueWrite

If true, the blue component of fragments generated by the shader of this material is written to the color buffer of the currently active render target. If false, the blue component will not be written. Defaults to true.

numbercull

Controls how triangles are culled based on their face direction with respect to the viewpoint. Can be:

  • CULLFACE_NONE: Do not cull triangles based on face direction.
  • CULLFACE_BACK: Cull the back faces of triangles (do not render triangles facing away from the view point).
  • CULLFACE_FRONT: Cull the front faces of triangles (do not render triangles facing towards the view point).

Defaults to CULLFACE_BACK.

numberdepthBias

Offsets the output depth buffer value. Useful for decals to prevent z-fighting.

numberdepthFunc

Controls how the depth of new fragments is compared against the current depth contained in the depth buffer. Can be:

Defaults to FUNC_LESSEQUAL.

DepthStatedepthState

Sets the depth state. Note that this can also be done by using Material#depthTest, Material#depthFunc and Material#depthWrite.

booleandepthTest

If true, fragments generated by the shader of this material are only written to the current render target if they pass the depth test. If false, fragments generated by the shader of this material are written to the current render target regardless of what is in the depth buffer. Defaults to true.

booleandepthWrite

If true, fragments generated by the shader of this material write a depth value to the depth buffer of the currently active render target. If false, no depth value is written. Defaults to true.

booleangreenWrite

If true, the green component of fragments generated by the shader of this material is written to the color buffer of the currently active render target. If false, the green component will not be written. Defaults to true.

stringname

The name of the material.

booleanredWrite

If true, the red component of fragments generated by the shader of this material is written to the color buffer of the currently active render target. If false, the red component will not be written. Defaults to true.

Shader, nullshader

The shader used by this material to render mesh instances (default is null).

numberslopeDepthBias

Same as Material#depthBias, but also depends on the slope of the triangle relative to the camera.

StencilParameters, nullstencilBack

Stencil parameters for back faces (default is null).

StencilParameters, nullstencilFront

Stencil parameters for front faces (default is null).

stringuserId

A unique id the user can assign to the material. The engine internally does not use this for anything, and the user can assign a value to this id for any purpose they like. Defaults to an empty string.

Methods

clone()

Clone a material.

Returns

this

A newly cloned material.

deleteParameter(name)

Deletes a shader parameter on a material.

Parameters

namestring

The name of the parameter to delete.

getParameter(name)

Retrieves the specified shader parameter from a material.

Parameters

namestring

The name of the parameter to query.

Returns

object

The named parameter.

setParameter(name, data)

Sets a shader parameter on a material.

Parameters

namestring

The name of the parameter to set.

datanumber, number[], Float32Array, Texture

The value for the specified parameter.

update()

Applies any changes made to the material's properties.