MeshMaterialMetallicRoughness

AMD: require(["esri/geometry/support/MeshMaterialMetallicRoughness"], (MeshMaterialMetallicRoughness) => { /* code goes here */ });
ESM: import MeshMaterialMetallicRoughness from "@arcgis/core/geometry/support/MeshMaterialMetallicRoughness.js";
Class: esri/geometry/support/MeshMaterialMetallicRoughness
Inheritance: MeshMaterialMetallicRoughness MeshMaterial Accessor
Since: ArcGIS Maps SDK for JavaScript 4.15

A material determines how a MeshComponent is visualized. This particular material (based on MeshMaterial) uses the metallic/roughness lighting model to enable physically based lighting. The metallic and roughness properties can be used to model various realistic materials including metals and plastics.

In this image you can see how metallic and roughness property values influence the display of the material:

The metallicRoughnessTexture can be used to map specific metallic/roughness properties on different parts of the model.

See also

Constructors

new MeshMaterialMetallicRoughness(properties)
Parameter
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
Number

Specifies how transparency on the object is handled.

more details
MeshMaterial
String

Specifies how transparency on the object is handled.

more details
MeshMaterial
Color

Specifies a single, uniform color for the mesh component.

more details
MeshMaterial
MeshTexture

Specifies a texture from which to get color information.

more details
MeshMaterial
MeshTextureTransform

A transformation of UV mesh coordinates used to sample the metallic roughness texture.

more details
MeshMaterialMetallicRoughness
String

The name of the class.

more details
Accessor
Boolean

Specifies whether both sides of each triangle are displayed, or only the front sides.

more details
MeshMaterial
Color

Specifies a single, uniform emissive color for the MeshComponent.

more details
MeshMaterialMetallicRoughness
MeshTexture

Specifies a texture from which to get emissive color information.

more details
MeshMaterialMetallicRoughness
MeshTextureTransform

A transformation of UV mesh coordinates used to sample the emissive texture.

more details
MeshMaterialMetallicRoughness
Number

Specifies how much the material behaves like a metal.

more details
MeshMaterialMetallicRoughness
MeshTexture

Specifies a texture from which to get the combined metallic/roughness information.

more details
MeshMaterialMetallicRoughness
MeshTexture

Specifies a texture from which to get normal information.

more details
MeshMaterial
MeshTextureTransform

A transformation of UV mesh coordinates used to sample the normal texture.

more details
MeshMaterial
MeshTexture

Allows to specify a texture to get the occlusion information from.

more details
MeshMaterialMetallicRoughness
MeshTextureTransform

A transformation of UV mesh coordinates used to sample the occlusion texture.

more details
MeshMaterialMetallicRoughness
Number

Indicates how rough the surface of the material is.

more details
MeshMaterialMetallicRoughness

Property Details

alphaCutoff Number inherited

Specifies how transparency on the object is handled. If alphaMode is set to either mask or auto this property specifies the cutoff value below which masking happens (that is, the coresponding part of the Mesh is rendered fully transparent).

Default Value:0.5
alphaMode String inherited

Specifies how transparency on the object is handled. See also alphaCutoff.

Type Description
opaque Alpha is ignored, and the object is rendered fully opaque.
blend Alpha values are used for gradual transparency, blending between the object and its background.
mask Alpha values are used for binary transparency, either displaying the object, or its background. See also alphaCutoff.
auto The implementation mixes the mask and blend settings, masking below alphaCutoff and blending above it.

Possible Values:"auto"|"blend"|"opaque"|"mask"

Default Value:"auto"
Autocasts from Object|Number[]|String

Specifies a single, uniform color for the mesh component. This can be autocast with a named string, hex string, array of rgb or rgba values, an object with r, g, b, and a properties, or a Color object.

Specifies a texture from which to get color information. The texture is accessed using the uv coordinate specified for each vertex in the Mesh.vertexAttributes.

colorTextureTransform MeshTextureTransform
Since: ArcGIS Maps SDK for JavaScript 4.27

A transformation of UV mesh coordinates used to sample the metallic roughness texture. Texture transformations can be used to optimize re-use of textures, for example by packing many images into a single texture "atlas" and using the texture transform offset and scale to sample a specific region within this larger texture.

Default Value:undefined
declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

doubleSided Boolean inherited

Specifies whether both sides of each triangle are displayed, or only the front sides.

Default Value:true
emissiveColor Colorautocast
Autocasts from Object|Number[]|String

Specifies a single, uniform emissive color for the MeshComponent. The emissiveColor is added to the base color of the component. This can be autocast with a named string, hex string, array of rgb values, an object with r, g, b properties, or a Color object. Note that the alpha channel is ignored for emissive colors.

emissiveTexture MeshTextureautocast

Specifies a texture from which to get emissive color information. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. The colors in the texture are added to the base color of the component. When using both an emissiveTexture and an emissiveColor their values are multiplied and then added to the base color of the component.

emissiveTextureTransform MeshTextureTransform
Since: ArcGIS Maps SDK for JavaScript 4.27

A transformation of UV mesh coordinates used to sample the emissive texture. Texture transformations can be used to optimize re-use of textures, for example by packing many images into a single texture "atlas" and using the texture transform offset and scale to sample a specific region within this larger texture.

Default Value:undefined
metallic Number

Specifies how much the material behaves like a metal. Values must be in the range 0 (non metal material) to 1 (metal material). Physically accurate materials are usually either a metal (1) or a non-metal (0) and not something inbetween.

Default Value:1
metallicRoughnessTexture MeshTextureautocast

Specifies a texture from which to get the combined metallic/roughness information. The metallic value should be stored in the blue channel, while the roughness value should be stored in the green channel. The red and alpha channels are ignored.

The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes.

Specifies a texture from which to get normal information. The texture is accessed using the uv coordinate specified for each vertex in the Mesh.vertexAttributes.

normalTextureTransform MeshTextureTransform inherited
Since: ArcGIS Maps SDK for JavaScript 4.27

A transformation of UV mesh coordinates used to sample the normal texture. Texture transformations can be used to optimize re-use of textures, for example by packing many images into a single texture "atlas" and using the texture transform offset and scale to sample a specific region within this larger texture.

Default Value:undefined
occlusionTexture MeshTextureautocast

Allows to specify a texture to get the occlusion information from. This can be used to simulate the effect of ambient light on the object. The texture is accessed using the uv coordinate specified for each vertex in the mesh vertex attributes. The occlusion value should be encoded in the red channel of the texture.

occlusionTextureTransform MeshTextureTransform
Since: ArcGIS Maps SDK for JavaScript 4.27

A transformation of UV mesh coordinates used to sample the occlusion texture. Texture transformations can be used to optimize re-use of textures, for example by packing many images into a single texture "atlas" and using the texture transform offset and scale to sample a specific region within this larger texture.

Default Value:undefined
roughness Number

Indicates how rough the surface of the material is. Values must be in the range 0 (fully smooth surface) to 1 (fully diffuse surface).

Default Value:1

Method Overview

Show inherited methods Hide inherited methods
Name Return Type Summary Class

Adds one or more handles which are to be tied to the lifecycle of the object.

more details
Accessor
Boolean

Returns true if a named group of handles exist.

more details
Accessor

Removes a group of handles owned by the object.

more details
Accessor

Method Details

addHandles(handleOrHandles, groupKey)inherited
Since: ArcGIS Maps SDK for JavaScript 4.25

Adds one or more handles which are to be tied to the lifecycle of the object. The handles will be removed when the object is destroyed.

// Manually manage handles
const handle = reactiveUtils.when(
  () => !view.updating,
  () => {
    wkidSelect.disabled = false;
  },
  { once: true }
);

this.addHandles(handle);

// Destroy the object
this.destroy();
Parameters
handleOrHandles WatchHandle|WatchHandle[]

Handles marked for removal once the object is destroyed.

groupKey *
optional

Key identifying the group to which the handles should be added. All the handles in the group can later be removed with Accessor.removeHandles(). If no key is provided the handles are added to a default group.

hasHandles(groupKey){Boolean}inherited
Since: ArcGIS Maps SDK for JavaScript 4.25

Returns true if a named group of handles exist.

Parameter
groupKey *
optional

A group key.

Returns
Type Description
Boolean Returns true if a named group of handles exist.
Example
// Remove a named group of handles if they exist.
if (obj.hasHandles("watch-view-updates")) {
  obj.removeHandles("watch-view-updates");
}
removeHandles(groupKey)inherited
Since: ArcGIS Maps SDK for JavaScript 4.25

Removes a group of handles owned by the object.

Parameter
groupKey *
optional

A group key or an array or collection of group keys to remove.

Example
obj.removeHandles(); // removes handles from default group

obj.removeHandles("handle-group");
obj.removeHandles("other-handle-group");

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.