Optionalparameters: MeshPhysicalMaterialParametersWhether it's possible to override the material with Scene#overrideMaterial or not.
Enables alpha hashed transparency, an alternative to Material#transparent or Material#alphaTest. The material will not be rendered if opacity is lower than a random threshold. Randomization introduces some grain or noise, but approximates alpha blending without the associated problems of sorting. Using TAA can reduce the resulting noise.
The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque).
Only the color of the texture is used, ignoring the alpha channel if one exists. For RGB and RGBA textures, the renderer will use the green channel when sampling this texture due to the extra bit of precision provided for green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and luminance/alpha textures will also still work as expected.
Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts
(meaning when the renderer was created with antialias parameter set to true). Enabling this
will smooth aliasing on clip plane edges and alphaTest-clipped edges.
Red and green channels represent the anisotropy direction in [-1, 1] tangent,
bitangent space, to be rotated by anisotropyRotation. The blue channel
contains strength as [0, 1] to be multiplied by anisotropy.
The rotation of the anisotropy in tangent, bitangent space, measured in radians
counter-clockwise from the tangent. When anisotropyMap is present, this
property provides additional rotation to the vectors in the texture.
The red channel of this texture is used as the ambient occlusion map. Requires a second set of UVs.
Intensity of the ambient occlusion effect. Range is [0,1], where 0
disables ambient occlusion. Where intensity is 1 and the AO map's
red channel is also 1, ambient light is fully occluded on a surface.
The color that white light turns into due to absorption when reaching the attenuation distance.
Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given in world space units, and must be greater than zero.
Represents the alpha value of the constant blend color.
This property has only an effect when using custom blending with ConstantAlpha or OneMinusConstantAlpha.
Represents the RGB values of the constant blend color.
This property has only an effect when using custom blending with ConstantColor or OneMinusConstantColor.
Defines the blending destination factor.
Defines the blending destination alpha factor.
Defines the blending equation.
Defines the blending equation of the alpha channel.
Defines the blending type of the material.
It must be set to CustomBlending if custom blending properties like
Material#blendSrc, Material#blendDst or Material#blendEquation
should have any effect.
Defines the blending source factor.
Defines the blending source alpha factor.
The texture to create a bump map. The black and white values map to the perceived depth in relation to the lights. Bump doesn't actually affect the geometry of the object, only the lighting. If a normal map is defined this will be ignored.
How much the bump map affects the material. Typical range is [0,1].
The red channel of this texture is multiplied against clearcoat,
for per-pixel control over a coating's intensity.
Can be used to enable independent normals for the clear coat layer.
How much clearcoatNormalMap affects the clear coat layer, from
(0,0) to (1,1).
Roughness of the clear coat layer, from 0.0 to 1.0.
The green channel of this texture is multiplied against
clearcoatRoughness, for per-pixel control over a coating's roughness.
Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
User-defined clipping planes specified as THREE.Plane objects in world
space. These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped
(not rendered). This requires WebGLRenderer#localClippingEnabled to
be true.
Defines whether to clip shadows according to the clipping planes specified on this material.
Color of the material.
Whether to render the material's color.
This can be used in conjunction with Object3D#renderOder to create invisible objects that occlude other objects.
OptionaldefinesDefines the depth function.
Whether to have depth test enabled when rendering this material. When the depth test is disabled, the depth write will also be implicitly disabled.
Whether rendering this material has any effect on the depth buffer.
When drawing 2D overlays it can be useful to disable the depth writing in order to layer several things together without creating z-index artifacts.
The offset of the displacement map's values on the mesh's vertices. The bias is added to the scaled sample of the displacement map. Without a displacement map set, this value is not applied.
The displacement map affects the position of the mesh's vertices. Unlike other maps which only affect the light and shade of the material the displaced vertices can cast shadows, block other objects, and otherwise act as real geometry. The displacement texture is an image where the value of each pixel (white being the highest) is mapped against, and repositions, the vertices of the mesh.
How much the displacement map affects the mesh (where black is no displacement, and white is maximum displacement). Without a displacement map set, this value is not applied.
Whether to apply dithering to the color to remove the appearance of banding.
Emissive (light) color of the material, essentially a solid color unaffected by other lighting.
Intensity of the emissive light. Modulates the emissive color.
Set emissive (glow) map. The emissive map color is modulated by the emissive color and the emissive intensity. If you have an emissive map, be sure to set the emissive color to something other than black.
The environment map. To ensure a physically correct rendering, environment maps are internally pre-processed with PMREMGenerator.
Scales the effect of the environment map by multiplying its color.
The rotation of the environment map in radians.
Whether the material is rendered with flat shading or not.
Whether the material is affected by fog or not.
Whether double-sided, transparent objects should be rendered with a single pass or not.
The engine renders double-sided, transparent objects with two draw calls (back faces first,
then front faces) to mitigate transparency artifacts. There are scenarios however where this
approach produces no quality gains but still doubles draw calls e.g. when rendering flat
vegetation like grass sprites. In these cases, set the forceSinglePass flag to true to
disable the two pass rendering to avoid performance issues.
Index-of-refraction for non-metallic materials, from 1.0 to 2.333.
Strength of the iridescence RGB color shift effect, represented by an index-of-refraction.
Between 1.0 to 2.333.
The red channel of this texture is multiplied against iridescence, for per-pixel
control over iridescence.
A texture that defines the thickness of the iridescence layer, stored in the green channel.
Minimum and maximum values of thickness are defined by iridescenceThicknessRange array:
0.0 in the green channel will result in thickness equal to first element of the array.1.0 in the green channel will result in thickness equal to second element of the array.Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.
Thickness of iridescence layer has an equivalent effect of the one thickness has on ior.
ReadonlyisThis flag can be used for type testing.
ReadonlyisThis flag can be used for type testing.
ReadonlyisThis flag can be used for type testing.
The light map. Requires a second set of UVs.
Intensity of the baked light.
The color map. May optionally include an alpha channel, typically combined
with Material#transparent or Material#alphaTest. The texture map
color is modulated by the diffuse color.
How much the material is like a metal. Non-metallic materials such as wood
or stone use 0.0, metallic use 1.0, with nothing (usually) in between.
A value between 0.0 and 1.0 could be used for a rusty metal look.
If metalnessMap is also provided, both values are multiplied.
The blue channel of this texture is used to alter the metalness of the material.
The name of the material.
The texture to create a normal map. The RGB values affect the surface
normal for each pixel fragment and change the way the color is lit. Normal
maps do not change the actual shape of the surface, only the lighting. In
case the material has a normal map authored using the left handed
convention, the y component of normalScale should be negated to compensate
for the different handedness.
The type of normal map.
How much the normal map affects the material. Typical value range is [0,1].
Defines how transparent the material is.
A value of 0.0 indicates fully transparent, 1.0 is fully opaque.
If the Material#transparent is not set to true,
the material will remain fully opaque and this value will only affect its color.
Whether to use polygon offset or not. When enabled, each fragment's depth value will be offset after it is interpolated from the depth values of the appropriate vertices. The offset is added before the depth test is performed and before the value is written into the depth buffer.
Can be useful for rendering hidden-line images, for applying decals to surfaces, and for rendering solids with highlighted edges.
Specifies a scale factor that is used to create a variable depth offset for each polygon.
Is multiplied by an implementation-specific value to create a constant depth offset.
Override the renderer's default precision for this material.
Whether to premultiply the alpha (transparency) value.
How rough the material appears. 0.0 means a smooth mirror reflection, 1.0
means fully diffuse. If roughnessMap is also provided,
both values are multiplied.
The green channel of this texture is used to alter the roughness of the material.
Defines which side of faces cast shadows. If null, the side casting shadows
is determined as follows:
FrontSide, the back side cast shadows.BackSide, the front side cast shadows.DoubleSide, both sides cast shadows.The sheen tint.
The RGB channels of this texture are multiplied against sheenColor, for per-pixel control
over sheen tint.
Roughness of the sheen layer, from 0.0 to 1.0.
The alpha channel of this texture is multiplied against sheenRoughness, for per-pixel control
over sheen roughness.
Defines which side of faces will be rendered - front, back or both.
Tints the specular reflection at normal incidence for non-metals only.
The RGB channels of this texture are multiplied against specularColor,
for per-pixel control over specular color.
A float that scales the amount of specular reflection for non-metals only.
When set to zero, the model is effectively Lambertian. From 0.0 to 1.0.
The alpha channel of this texture is multiplied against specularIntensity,
for per-pixel control over specular intensity.
Which stencil operation to perform when the comparison function returns false.
The stencil comparison function to use.
The bit mask to use when comparing against the stencil buffer.
The value to use when performing stencil comparisons or stencil operations.
Whether stencil operations are performed against the stencil buffer. In
order to perform writes or comparisons against the stencil buffer this
value must be true.
The bit mask to use when writing to the stencil buffer.
Which stencil operation to perform when the comparison function returns
true but the depth test fails.
Which stencil operation to perform when the comparison function returns
true and the depth test passes.
The thickness of the volume beneath the surface. The value is given in the
coordinate space of the mesh. If the value is 0 the material is
thin-walled. Otherwise the material is a volume boundary.
A texture that defines the thickness, stored in the green channel. This will
be multiplied by thickness.
Defines whether this material is tone mapped according to the renderer's tone mapping setting.
It is ignored when rendering to a render target or using post processing or when using
WebGPURenderer. In all these cases, all materials are honored by tone mapping.
The red channel of this texture is multiplied against transmission, for per-pixel control over
optical transparency.
Defines whether this material is transparent. This has an effect on rendering as transparent objects need special treatment and are rendered after non-transparent objects.
When set to true, the extent to which the material is transparent is controlled by Material#opacity.
The type property is used for detecting the object type in context of serialization/deserialization.
An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned.
ReadonlyuuidThe UUID of the material.
ReadonlyversionThis starts at 0 and counts how many times Material#needsUpdate is set to true.
If set to true, vertex colors should be used.
The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or four (RGBA) component color buffer attribute is used.
Defines whether 3D objects using this material are visible.
Renders the geometry as a wireframe.
Defines appearance of wireframe ends.
Can only be used with SVGRenderer.
Defines appearance of wireframe joints.
Can only be used with SVGRenderer.
Controls the thickness of the wireframe.
Can only be used with SVGRenderer.
Degree of transmission (or optical transparency), from 0.0 to 1.0.
Thin, transparent or semitransparent, plastic or glass materials remain largely reflective even if they are fully transmissive. The transmission property can be used to model these materials.
When transmission is non-zero, opacity should be set to 1.
Adds a listener to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
Returns a new material with copied values from this instance.
A clone of this instance.
Copies the values of the given material to this instance.
The material to copy.
A reference to this instance.
In case Material#onBeforeCompile is used, this callback can be used to identify
values of settings used in onBeforeCompile(), so three.js can reuse a cached
shader or recompile the shader for this material as needed.
This method can only be used when rendering with WebGLRenderer.
The custom program cache key.
Checks if listener is added to an event type.
The type of event to listen to.
The function that gets called when the event is fired.
An optional callback that is executed immediately before the shader program is compiled. This function is called with the shader source code as a parameter. Useful for the modification of built-in materials.
This method can only be used when rendering with WebGLRenderer. The
recommended approach when customizing materials is to use WebGPURenderer with the new
Node Material system and TSL.
A reference to the renderer.
An optional callback that is executed immediately before the material is used to render a 3D object.
This method can only be used when rendering with WebGLRenderer.
The renderer.
The scene.
The camera that is used to render the scene.
The 3D object's geometry.
The 3D object.
The geometry group data.
Removes a listener from an event type.
The type of the listener that gets removed.
The listener function that gets removed.
This method can be used to set default values from parameter objects. It is a generic implementation so it can be used with different types of materials.
Optionalvalues: MeshPhysicalMaterialParametersThe material values to set.
Serializes the material into JSON.
Optionalmeta: JSONMetaAn optional value holding meta information about the serialization.
A JSON object representing the serialized material.
An extension of the MeshStandardMaterial, providing more advanced physically-based rendering properties:
As a result of these complex shading features,
MeshPhysicalMaterialhas a higher performance cost, per pixel, than other three.js materials. Most effects are disabled by default, and add cost as they are enabled. For best results, always specify an environment map when using this material.