Capítulo 79 de 859

Chapter 79: MeshPhysicalMaterial

Core Idea

An extension of the MeshStandardMaterial, providing more advanced physically-based rendering properties:

  • Anisotropy: Ability to represent the anisotropic property of materials as observable with brushed metals.
  • Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require a clear, reflective layer on top of another layer that may be irregular or rough. Clearcoat approximates this effect, without the need for a separate transparent surface.
  • Iridescence: Allows to render the effect where hue varies depending on the viewing angle and illumination angle. This can be seen on soap bubbles, oil films, or on the wings of many insects.
  • Physically-based transparency: One limitation of Material#opacity is that highly transparent materials are less reflective. Physically-based transmission provides a more realistic option for thin, transparent surfaces like glass.
  • Advanced reflectivity: More flexible reflectivity for non-metallic materials.
  • Sheen: Can be used for representing cloth and fabric materials.

As a result of these complex shading features, MeshPhysicalMaterial has 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.

Key Concepts

  • anisotropy : number: The anisotropy strength, from 0.0 to 1.0.
  • anisotropyMap : Texture: Red and green channels represent the anisotropy direction in [-1, 1] tangent, bitangent space, to be rotated by anisotropyRotation. The…
  • anisotropyRotation : number: The rotation of the anisotropy in tangent, bitangent space, measured in radians counter-clockwise from the tangent. When anisotropyMap is…
  • attenuationColor : Color: The color that white light turns into due to absorption when reaching the attenuation distance.
  • attenuationDistance : number: Density of the medium given as the average distance that light travels in the medium before interacting with a particle. The value is given…
  • clearcoat : number: Represents the intensity of the clear coat layer, from 0.0 to 1.0. Use clear coat related properties to enable multilayer materials tha…
  • clearcoatMap : Texture: The red channel of this texture is multiplied against clearcoat, for per-pixel control over a coating's intensity.
  • clearcoatNormalMap : Texture: Can be used to enable independent normals for the clear coat layer.
  • clearcoatNormalScale : Vector2: How much clearcoatNormalMap affects the clear coat layer, from (0,0) to (1,1).
  • clearcoatRoughness : number: Roughness of the clear coat layer, from 0.0 to 1.0.

Reference Tables

Constructor

Signature
new MeshPhysicalMaterial( parameters : Object )

Properties

PropertyDescription
.anisotropy : numberThe anisotropy strength, from 0.0 to 1.0.
.anisotropyMap : TextureRed 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…
.anisotropyRotation : numberThe 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 …
.attenuationColor : ColorThe color that white light turns into due to absorption when reaching the attenuation distance.
.attenuationDistance : numberDensity 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.
.clearcoat : numberRepresents the intensity of the clear coat layer, from 0.0 to 1.0. Use clear coat related properties to enable multilayer materials that have a thin translucent layer over the base layer.
.clearcoatMap : TextureThe red channel of this texture is multiplied against clearcoat, for per-pixel control over a coating's intensity.
.clearcoatNormalMap : TextureCan be used to enable independent normals for the clear coat layer.
.clearcoatNormalScale : Vector2How much clearcoatNormalMap affects the clear coat layer, from (0,0) to (1,1).
.clearcoatRoughness : numberRoughness of the clear coat layer, from 0.0 to 1.0.
.clearcoatRoughnessMap : TextureThe green channel of this texture is multiplied against clearcoatRoughness, for per-pixel control over a coating's roughness.
.dispersion : numberDefines the strength of the angular separation of colors (chromatic aberration) transmitting through a relatively clear volume. Any value zero or larger is valid, the typical range of realistic value…
.ior : numberIndex-of-refraction for non-metallic materials, from 1.0 to 2.333.
.iridescence : numberThe intensity of the iridescence layer, simulating RGB color shift based on the angle between the surface and the viewer, from 0.0 to 1.0.
.iridescenceIOR : numberStrength of the iridescence RGB color shift effect, represented by an index-of-refraction. Between 1.0 to 2.333.
.iridescenceMap : TextureThe red channel of this texture is multiplied against iridescence, for per-pixel control over iridescence.
.iridescenceThicknessMap : TextureA 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:
.iridescenceThicknessRange : Array.<number, number>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.
.isMeshPhysicalMaterial : boolean (readonly)This flag can be used for type testing.
.reflectivity : numberDegree of reflectivity, from 0.0 to 1.0. Default is 0.5, which corresponds to an index-of-refraction of 1.5.
.sheen : numberThe intensity of the sheen layer, from 0.0 to 1.0.
.sheenColor : ColorThe sheen tint.
.sheenColorMap : TextureThe RGB channels of this texture are multiplied against sheenColor, for per-pixel control over sheen tint.
.sheenRoughness : numberRoughness of the sheen layer, from 0.0 to 1.0.
.sheenRoughnessMap : TextureThe alpha channel of this texture is multiplied against sheenRoughness, for per-pixel control over sheen roughness.
.specularColor : ColorTints the specular reflection at normal incidence for non-metals only.
.specularColorMap : TextureThe RGB channels of this texture are multiplied against specularColor, for per-pixel control over specular color.
.specularIntensity : numberA 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.
.specularIntensityMap : TextureThe alpha channel of this texture is multiplied against specularIntensity, for per-pixel control over specular intensity.
.thickness : numberThe 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.
.thicknessMap : TextureA texture that defines the thickness, stored in the green channel. This will be multiplied by thickness.
.transmission : numberDegree of transmission (or optical transparency), from 0.0 to 1.0.
.transmissionMap : TextureThe red channel of this texture is multiplied against transmission, for per-pixel control over optical transparency.

Key Takeaways

  1. MeshPhysicalMaterial extends: EventDispatcher → Material → MeshStandardMaterial
  2. Most relevant properties: anisotropy, anisotropyMap, anisotropyRotation, attenuationColor.

Connects To