Gets the alpha test reference value.
The alpha test reference value.
Sets the alpha test reference value. Fragments with an opacity below this value are discarded.
The alpha test reference value.
Gets whether to use alpha to coverage.
The alpha to coverage flag.
Sets whether to use alpha to coverage, which resolves transparency using multisampling.
The alpha to coverage flag.
Gets the strength of the ambient occlusion map.
The ambient occlusion intensity.
Sets the strength of the ambient occlusion map, from 0 to 1.
The ambient occlusion intensity.
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 color channel of the ambient occlusion map to sample.
The channel.
Sets the color channel of the ambient occlusion map to sample.
The channel.
Gets the 2D rotation of the ambient occlusion map.
The rotation.
Sets the 2D rotation of the ambient occlusion map, in degrees.
The rotation.
Gets the UV channel the ambient occlusion map samples.
The UV channel.
Sets the UV channel the ambient occlusion map samples.
The UV channel.
Gets how the material is blended with the scene behind it.
The blend type.
Sets how the material is blended with the scene behind it.
The blend type.
Gets the strength of the normal map.
The bumpiness.
Sets the strength of the normal map, where 0 is flat and 1 is the map's full effect.
The bumpiness.
Gets which faces of a mesh are culled.
The cull mode.
Sets which faces of a mesh are culled.
The cull mode.
Gets the offset applied to the depth of a fragment.
The depth bias.
Sets the offset applied to the depth of a fragment, used to resolve z-fighting.
The depth bias.
Gets whether fragments are tested against the depth buffer.
The depth test flag.
Sets whether fragments are tested against the depth buffer.
The depth test flag.
Gets whether fragments write to the depth buffer.
The depth write flag.
Sets whether fragments write to the depth buffer.
The depth write flag.
Sets the diffuse color of the material. With the metalness workflow this doubles as the specular color where the surface is metallic.
The diffuse color.
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 color channels of the diffuse map to sample.
The channels.
Sets the color channels of the diffuse map to sample.
The channels.
Gets the 2D rotation of the diffuse map.
The rotation.
Sets the 2D rotation of the diffuse map, in degrees.
The rotation.
Gets the UV channel the diffuse map samples.
The UV channel.
Sets the UV channel the diffuse map samples.
The UV channel.
Sets the emissive color of the material, which is added to the lit result.
The emissive color.
Gets the multiplier applied to the emissive color and map.
The emissive intensity.
Sets the multiplier applied to the emissive color and map.
The emissive intensity.
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 color channels of the emissive map to sample.
The channels.
Sets the color channels of the emissive map to sample.
The channels.
Gets the 2D rotation of the emissive map.
The rotation.
Sets the 2D rotation of the emissive map, in degrees.
The rotation.
Gets the UV channel the emissive map samples.
The UV channel.
Sets the UV channel the emissive map samples.
The UV channel.
Gets whether to use the GGX specular model.
The GGX specular flag.
Sets whether to use the GGX specular model, which supports anisotropy.
The GGX specular flag.
Gets the Fresnel model used for specular reflections at grazing angles.
The Fresnel model.
Sets the Fresnel model used for specular reflections at grazing angles.
The Fresnel model.
Gets the glossiness of the material.
The gloss.
Sets the glossiness of the material, from 0 (rough) to 1 (shiny). See also roughness.
The gloss.
Gets whether the gloss value and map are inverted.
The gloss invert flag.
Sets whether the gloss value and map are inverted, which makes the material treat them as
roughness. Setting roughness or roughness-map enables this automatically.
The gloss invert flag.
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 color channel of the gloss map to sample.
The channel.
Sets the color channel of the gloss map to sample.
The channel.
Gets the 2D rotation of the gloss map.
The rotation.
Sets the 2D rotation of the gloss map, in degrees.
The rotation.
Gets the UV channel the gloss map samples.
The UV channel.
Sets the UV channel the gloss map samples.
The UV channel.
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 color channel of the height map to sample.
The channel.
Sets the color channel of the height map to sample.
The channel.
Gets the strength of the parallax effect driven by the height map.
The height map factor.
Sets the strength of the parallax effect driven by the height map.
The height map factor.
Gets the 2D rotation of the height map.
The rotation.
Sets the 2D rotation of the height map, in degrees.
The rotation.
Gets the UV channel the height map samples.
The UV channel.
Sets the UV channel the height map samples.
The UV channel.
Gets how metallic the surface is.
The metalness.
Sets how metallic the surface is, from 0 (dielectric) to 1 (metal).
The metalness.
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 color channel of the metalness map to sample.
The channel.
Sets the color channel of the metalness map to sample.
The channel.
Gets the 2D rotation of the metalness map.
The rotation.
Sets the 2D rotation of the metalness map, in degrees.
The rotation.
Gets the UV channel the metalness map samples.
The UV channel.
Sets the UV channel the metalness map samples.
The UV channel.
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 2D rotation of the normal map.
The rotation.
Sets the 2D rotation of the normal map, in degrees.
The rotation.
Gets the UV channel the normal map samples.
The UV channel.
Sets the UV channel the normal map samples.
The UV channel.
Gets whether ambient occlusion also attenuates direct lighting.
The occlude direct flag.
Sets whether ambient occlusion also attenuates direct lighting.
The occlude direct flag.
Gets how specular reflections are occluded.
The specular occlusion mode.
Sets how specular reflections are occluded.
The specular occlusion mode.
Gets the opacity of the material, which requires a blend-type other than none to have
any visible effect.
The opacity.
Sets the opacity of the material, from 0 (transparent) to 1 (opaque), which requires a
blend-type other than none to have any visible effect.
The opacity.
Gets the dithering used to render opacity.
The dither mode.
Sets the dithering used to render opacity, which approximates transparency without blending.
The dither mode.
Gets whether specular highlights fade out as the material becomes transparent.
The opacity fades specular flag.
Sets whether specular highlights fade out as the material becomes transparent.
The opacity fades specular flag.
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 color channel of the opacity map to sample.
The channel.
Sets the color channel of the opacity map to sample.
The channel.
Gets the 2D rotation of the opacity map.
The rotation.
Sets the 2D rotation of the opacity map, in degrees.
The rotation.
Gets the UV channel the opacity map samples.
The UV channel.
Sets the UV channel the opacity map samples.
The UV channel.
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.
Gets the depth offset applied in proportion to a surface's slope.
The slope depth bias.
Sets the depth offset applied in proportion to a surface's slope, used to resolve z-fighting.
The slope depth bias.
Gets the specular color of the material, which applies only when the metalness workflow is
disabled or use-metalness-specular-color is enabled.
The specular color.
Sets the specular color of the material, which applies only when the metalness workflow is
disabled or use-metalness-specular-color is enabled.
The specular color.
Gets the strength of specular reflections at direct angles, which applies only when
use-metalness-specular-color is enabled.
The specularity factor.
Sets the strength of specular reflections at direct angles, from 0 to 1, which applies only
when use-metalness-specular-color is enabled.
The specularity factor.
Gets whether back faces are lit as though their normals were flipped.
The two sided lighting flag.
Sets whether back faces are lit as though their normals were flipped.
The two sided lighting flag.
Gets whether the material is affected by scene fog.
The use fog flag.
Sets whether the material is affected by scene fog.
The use fog flag.
Gets whether the material is affected by scene lights.
The use lighting flag.
Sets whether the material is affected by scene lights. When disabled the material renders unlit, using the diffuse color and map alone.
The use lighting flag.
Gets whether to use the metalness workflow.
The use metalness flag.
Sets whether to use the metalness workflow rather than the older specular workflow. Unlike a
bare StandardMaterial this defaults to true, because the metalness-* attributes have no
effect without it.
The use metalness flag.
Gets whether the specular color tints reflections while the metalness workflow is in use.
The use metalness specular color flag.
Sets whether the specular color tints reflections while the metalness workflow is in use.
The use metalness specular color flag.
Gets whether the material is lit by the scene's skybox.
The use skybox flag.
Sets whether the material is lit by the scene's skybox.
The use skybox flag.
Gets whether the camera's tone mapping is applied to the material.
The use tonemap flag.
Sets whether the camera's tone mapping is applied to the material.
The use tonemap flag.
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.