Class: PhysicalMaterial

X3DOM
Component: Shape

.nodeTypes. PhysicalMaterial

This is the base node type for all Material nodes.

HTML Encoding and Default Values

<PhysicalMaterial alphaCutoff='0.5' alphaMode=''OPAQUE'' ambientIntensity='0.2' baseColorFactor='1,1,1,1' baseColorTexture='' diffuseColor='0.8,0.8,0.8' diffuseFactor='1,1,1' emissiveColor='0,0,0' emissiveFactor='0,0,0' emissiveTexture='' glossinessFactor='1' metadata='X3DMetadataObject' metallicFactor='0.0' model='roughnessMetallic' normalBias='-1,-1, 1' normalScale='1' normalSpace=''TANGENT'' normalTexture='' occlusionRoughnessMetallic='' occlusionTexture='' roughnessFactor='0.2' roughnessMetallicTexture='' shininess='0.2' specularColor='0,0,0' specularFactor='1,1,1' specularGlossinessTexture='' transparency='0' unlit='false' ></PhysicalMaterial>

Inheritance


Constructor

PhysicalMaterial(ctx)

Constructor for X3DMaterialNode

Parameters:
Name Type Argument Default Description
ctx Object <optional>
null context object, containing initial settings like namespace

Fields

These are the X3D / X3DOM fields of this node. Values should usually be received / set as strings via DOM functions (i.e., using setAttribute("myFieldName", "myFieldValue") and getAttribute("myFieldName")).
Name Type Default Value Range Inheritance Standard Description
alphaCutoff SFFloat 0.5 [0, 1] Specifies the cutoff threshold when in `MASK` alpha mode. If the alpha value is greater than or equal to this value then it is rendered as fully opaque, otherwise, it is rendered as fully transparent. A value greater than 1.0 will render the entire material as fully transparent. This value is ignored for other modes.
alphaMode SFString 'OPAQUE' [OPAQUE, BLEND, MASK] The material's alpha rendering mode enumeration specifying the interpretation of the alpha value of the main factor and texture.
ambientIntensity SFFloat 0.2 [0, 1] X3DMaterialNode The ambientIntensity field specifies how much ambient light from light sources this surface shall reflect. Ambient light is omnidirectional and depends only on the number of light sources, not their positions with respect to the surface. Ambient colour is calculated as ambientIntensity Ă— diffuseColor.
baseColorFactor SFColor 1,1,1,1 The RGBA components of the base color of the material. The fourth component (A) is the alpha coverage of the material. The `alphaMode` property specifies how alpha is interpreted. These values are linear. If a baseColorTexture is specified, this value is multiplied with the texel values.
baseColorTexture X3DTextureNode The base color texture in the met. rough. model. This texture contains RGB(A) components in sRGB color space. The first three components (RGB) specify the base color of the material. If the fourth component (A) is present, it represents the alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed. The `alphaMode` property specifies how alpha is interpreted. The stored texels must not be premultiplied.
diffuseColor SFColor 0.8,0.8,0.8 X3DMaterialNode The diffuseColor field reflects all X3D light sources depending on the angle of the surface with respect to the light source. The more directly the surface faces the light, the more diffuse light reflects. The emissiveColor field models "glowing" objects. This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.
diffuseFactor SFColor 1,1,1 The RGBA components of the reflected diffuse color of the material used in the spec.-gloss. model. Metals have a diffuse value of '0.0, 0.0, 0.0'. The fourth component (A) is the opacity of the material. The values are linear.
emissiveColor SFColor 0,0,0 X3DMaterialNode The emissiveColor field models "glowing" objects. This can be useful for displaying pre-lit models (where the light energy of the room is computed explicitly), or for displaying scientific data.
emissiveFactor SFColor 0,0,0 The RGB components of the emissive color of the material. These values are linear. If an emissiveTexture is specified, this value is multiplied with the texel values.
emissiveTexture X3DTextureNode The emissive map controls the color and intensity of the light being emitted by the material. This texture contains RGB components in sRGB color space. If a fourth component (A) is present, it is ignored.
glossinessFactor SFFloat 1 [0, 1] The glossiness or smoothness of the material used in the spec.-gloss. model. A value of 1.0 means the material has full glossiness or is perfectly smooth. A value of 0.0 means the material has no glossiness or is perfectly rough. This value is linear.
metadata SFNode X3DMetadataObject X3DNode Field to add metadata information
metallicFactor SFFloat 0.0 [0, 1] The metalness of the material. A value of 1.0 means the material is a metal. A value of 0.0 means the material is a dielectric. Values in between are for blending between metals and dielectrics such as dirty metallic surfaces. This value is linear. If a roughnessMetallicTexture is specified, this value is multiplied with the metallic texel values.
model SFString roughnessMetallic The material model used. Valid values are "roughnessMetallic" and "specularGlossiness".
normalBias SFVec3f -1,-1, 1 Bias to apply to normal sampled from normalTexture
normalScale SFVec3f 1 Scale to apply to normal sampled from normalTexture. NYI
normalSpace SFString 'TANGENT' [TANGENT, OBJECT] Space in which normals of the normalTexture are defined. Valid values are "TANGENT" and "OBJECT".
normalTexture X3DTextureNode A tangent space normal map. The texture contains RGB components in linear space. Each texel represents the XYZ components of a normal vector in tangent space. Red [0 to 255] maps to X [-1 to 1]. Green [0 to 255] maps to Y [-1 to 1]. Blue [128 to 255] maps to Z [1/255 to 1]. The normal vectors use OpenGL conventions where +X is right and +Y is up. +Z points toward the viewer. In GLSL, this vector would be unpacked like so: `float3 normalVector = tex2D(, texCoord) * 2 - 1`. Client implementations should normalize the normal vectors before using them in lighting equations.
occlusionRoughnessMetallic X3DTextureNode Specifies a texture with the packing Occlusion (R), Roughness (G), Metallic (B)
occlusionTexture X3DTextureNode The occlusion map texture. The occlusion values are sampled from the R channel. Higher values indicate areas that should receive full indirect lighting and lower values indicate no indirect lighting. These values are linear. If other channels are present (GBA), they are ignored for occlusion calculations.
roughnessFactor SFFloat 0.2 [0, 1] The roughness of the material. A value of 1.0 means the material is completely rough. A value of 0.0 means the material is completely smooth. This value is linear. If a roughnessMetallicTexture is specified, this value is multiplied with the roughness texel values.
roughnessMetallicTexture X3DTextureNode The metallic-roughness texture. The metalness values are sampled from the B channel. The roughness values are sampled from the G channel. These values are linear. If other channels are present (R or A), they are ignored for metallic-roughness calculations.
shininess SFFloat 0.2 [0, 1] X3DMaterialNode The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
specularColor SFColor 0,0,0 X3DMaterialNode The specularColor and shininess fields determine the specular highlights (e.g., the shiny spots on an apple). When the angle from the light to the surface is close to the angle from the surface to the viewer, the specularColor is added to the diffuse and ambient colour calculations. Lower shininess values produce soft glows, while higher values result in sharper, smaller highlights.
specularFactor SFColor 1,1,1 The specular RGB color of the material used in the spec.-gloss. model. This value is linear.
specularGlossinessTexture X3DTextureNode The specular-glossiness texture is a RGBA texture, containing the specular color (RGB) in sRGB space and the glossiness value (A) in linear space.
transparency SFFloat 0 [0, 1] X3DMaterialNode The transparency field specifies how "clear" an object is, with 1.0 being completely transparent, and 0.0 completely opaque.
unlit SFBool false Set the material to unlit Final color is the product of baseColorFactor, baseColorTexture, and vertex color (if any)