The alpha used by opacity dithering, which needs an opacity-dither mode other than none.
It ranges from 0 to 1, and lets a material be alpha blended by opacity and dithered by
this at the same time. Defaults to null, which dithers by opacity.
The alpha test reference value. Fragments with an opacity below this value are discarded.
Whether to use alpha to coverage. It resolves transparency using multisampling.
The strength of the ambient occlusion map. It ranges from 0 to 1.
The color channel of the ambient occlusion map to sample.
The 2D offset of the ambient occlusion map.
The 2D rotation of the ambient occlusion map. It is in degrees.
The 2D tiling of the ambient occlusion map.
The UV channel the ambient occlusion map samples.
How the material is blended with the scene behind it.
The strength of the normal map. 0 is flat and 1 is the map's full effect.
Which faces of a mesh are culled.
The offset applied to the depth of a fragment. It is used to resolve z-fighting.
Whether fragments are tested against the depth buffer.
Whether fragments write to the depth buffer.
The diffuse color of the material. With the metalness workflow this doubles as the specular color where the surface is metallic.
The color channels of the diffuse map to sample.
The 2D offset of the diffuse map.
The 2D rotation of the diffuse map. It is in degrees.
The 2D tiling of the diffuse map.
The UV channel the diffuse map samples.
The emissive color of the material. It is added to the lit result.
The multiplier applied to the emissive color and map.
The color channels of the emissive map to sample.
The 2D offset of the emissive map.
The 2D rotation of the emissive map. It is in degrees.
The 2D tiling of the emissive map.
The UV channel the emissive map samples.
Whether to use the GGX specular model. It supports anisotropy.
Whether the material is shaded with the geometric normal of each triangle. That is in place of the normals interpolated from its vertices, and gives the surface a faceted look.
The Fresnel model used for specular reflections at grazing angles.
The glossiness of the material. It ranges from 0 (rough) to 1 (shiny). See also roughness.
Whether the gloss value and map are inverted. Inverting them makes the material treat them
as roughness. Setting roughness or roughness-map enables this automatically.
The color channel of the gloss map to sample.
The 2D offset of the gloss map.
The 2D rotation of the gloss map. It is in degrees.
The 2D tiling of the gloss map.
The UV channel the gloss map samples.
The height map value that sits at the level of the geometry. It ranges from 0 to 1: relief above it stands out of the surface and relief below it sinks in. Defaults to 0.5; 1 treats the map as pure depth and 0 as pure elevation.
The color channel of the height map to sample.
The strength of the parallax effect driven by the height map.
The 2D offset of the height map.
The 2D rotation of the height map. It is in degrees.
The 2D tiling of the height map.
The UV channel the height map samples.
The material. null until the containing application has created it — an element present
at startup has its material once the application is ready.
How metallic the surface is. It ranges from 0 (dielectric) to 1 (metal).
The color channel of the metalness map to sample.
The 2D offset of the metalness map.
The 2D rotation of the metalness map. It is in degrees.
The 2D tiling of the metalness map.
The UV channel the metalness map samples.
The name of the material - the label shown wherever materials surface by name, such as
profilers, GPU captures and the assignments pc-model.hierarchy() reports. Purely a label:
element references resolve through id.
The 2D offset of the normal map.
The 2D rotation of the normal map. It is in degrees.
The 2D tiling of the normal map.
The UV channel the normal map samples.
Whether ambient occlusion also attenuates direct lighting.
How specular reflections are occluded.
The opacity of the material, which requires a blend-type other than none to have any
visible effect. It ranges from 0 (transparent) to 1 (opaque).
The dithering used to render opacity. It approximates transparency without blending.
Whether specular highlights fade out as the material becomes transparent.
The color channel of the opacity map to sample.
The 2D offset of the opacity map.
The 2D rotation of the opacity map. It is in degrees.
The 2D tiling of the opacity map.
The UV channel the opacity map samples.
How the height map offsets the UVs of the other maps. Can be:
offset - A single tap of the height map.occlusion - Marches the view ray through the height field, for deeper relief without
smearing at the cost of several taps per pixel. The silhouette of the mesh is unchanged.Defaults to offset.
The maximum number of height map taps along the view ray, which applies only when
parallax-mode is occlusion. Defaults to 16.
The maximum number of height map taps towards each directional light, which applies only
when parallax-mode is occlusion. The taps soft-shadow the relief against itself.
Defaults to 0, no self-shadowing.
The depth offset applied in proportion to a surface's slope. It is used to resolve z-fighting.
The specular color of the material, which applies only when the metalness workflow is
disabled or use-metalness-specular-color is enabled.
The strength of specular reflections at direct angles, which applies only when
use-metalness-specular-color is enabled. It ranges from 0 to 1.
Whether back faces are lit as though their normals were flipped.
Whether the material is affected by scene fog.
Whether the material is affected by scene lights. When disabled the material renders unlit, using the diffuse color and map alone.
Whether to use the metalness workflow. The alternative is the older specular workflow.
Unlike a bare StandardMaterial this defaults to true, because the metalness-*
attributes have no effect without it.
Whether the specular color tints reflections while the metalness workflow is in use.
Whether the material is lit by the scene's skybox.
Whether the camera's tone mapping is applied to the material.
Gets the id of the pc-asset used as the ambient occlusion map.
The asset id.
Sets the id of the pc-asset to use as the ambient occlusion map.
The asset id.
Gets the id of the pc-asset used as the diffuse map.
The asset id.
Sets the id of the pc-asset to use as the diffuse map.
The asset id.
Gets the id of the pc-asset used as the emissive map.
The asset id.
Sets the id of the pc-asset to use as the emissive map.
The asset id.
Gets the id of the pc-asset used as the gloss map.
The asset id.
Sets the id of the pc-asset to use as the gloss map. See also roughnessMap.
The asset id.
Gets the id of the pc-asset used as the height map.
The asset id.
Sets the id of the pc-asset to use as the height map, which drives parallax mapping.
The asset id.
Gets the id of the pc-asset used as the metalness map.
The asset id.
Sets the id of the pc-asset to use as the metalness map.
The asset id.
Gets the id of the pc-asset used as the normal map.
The asset id.
Sets the id of the pc-asset to use as the normal map.
The asset id.
Gets the id of the pc-asset used as the opacity map.
The asset id.
Sets the id of the pc-asset to use as the opacity map.
The asset id.
Gets the roughness of the material.
The roughness.
Sets the roughness of the material, from 0 (shiny) to 1 (rough). This is an alias for gloss
that also inverts the gloss channel, so do not combine it with the gloss attributes.
The roughness.
Gets the id of the pc-asset used as the roughness map.
The asset id.
Sets the id of the pc-asset to use as the roughness map. This is an alias for glossMap
that also inverts the gloss channel, so do not combine it with the gloss attributes.
The asset id.
StaticgetReturns the StandardMaterial created by the <pc-material> element with the given
id, or undefined if there is no such element or its material has not been created yet.
The id is an element id. Given the element that refers to the material, it is looked for in
that element's <pc-app> first and then in the tree the element is in, which is the
document unless the application is inside a shadow root. That is how the library's own
elements resolve a material, and what keeps two applications that use the same id apart.
Without an element, only the document is searched.
The id of the <pc-material> element.
Optionalfrom: Element
The element that refers to the material.
The material, or undefined.
The MaterialElement interface provides properties and methods for manipulating
<pc-material>elements. The MaterialElement interface also inherits the properties and methods of the HTMLElement interface.A
pc-materialmust be a direct child ofpc-app— elements placed elsewhere log a warning and never create a material. Elements inserted while the application is already running are created on insertion.The element is metal/rough by default: unlike a bare
StandardMaterialit enables the metalness workflow, which is what themetalness-*attributes assume and what glTF means by PBR. It also defaultsmetalnessto 0 rather than the engine's 1, because those two defaults have to be chosen together - the engine's 1 is unreachable under its ownuseMetalnessof false, and with the workflow on it would make every material fully metallic, so<pc-material diffuse="crimson">would render as dark tinted reflections of an environment that may not exist rather than as a crimson surface.metalness="1"remains one attribute away.The
roughnessandroughness-mapattributes are aliases forglossandgloss-mapthat additionally invert the gloss channel; do not mix the two families on one element.The two aliases are documented here rather than on an accessor, because they resolve to the
glossproperties and would otherwise inherit gloss's description - which reads inverted.Attribute
roughness - The roughness of the material, from 0 (shiny) to 1 (rough). An alias for
glossthat also inverts it, so do not combine it with theglossattributes.Attribute
roughness-map - The id of the
pc-assetto use as the roughness map. An alias forgloss-mapthat also inverts the gloss channel, so do not combine it with theglossattributes.