Copyright © 2021 by K4.org
  (v.0.48.124)

The Material Design defines a material, which is the only way to control the rendering of objects. Even a simple color, when first used, will create a material by the same name and store it in the material table under that name. Thereafter, any object which specifies the same color in its color parameter will use that stored material. By default, the materials created automatically in this way are defined to look something like plastic, with medium reflectivity, highlighting, and so on.

To create your own materials, you need to use the Material Design defined here. Materials and their properties in general are a very complex topic, and only a simplified version is supported here.

Index

Rules

__mod3

__mod3: String

Internal Use Only.

Flags : Cached, External, Update (Note this is uncached)

Expression : R.THREE.makeMaterial(this.materialName, this.materialType, this.spec)

alphaMap

alphaMap: String

The name of the texture to use as an alpha map. Must be in the texture table from an already-defined Texture. The alpha map is a grayscale texture that controls the opacity across the surface (black: fully transparent; white: fully opaque).

Flags : Cached, Parameter (Note this is uncached)

Expression : ""

color

color: String

The color to actually use in this material. This is sometimes called the 'diffuse color'. This should be an RGB value or an existing predefined color name.

Flags : Cached, Parameter (Note this is uncached)

Expression : "Default"

colorName

colorName: String

The name of this material. This forces the material to be inserted into the material table.

Flags : Cached (Note this is uncached)

Expression : this.__mod3; return this.materialName;

materialID

materialID: String

The name of this material. This forces the material to be inserted into the material table.

Flags : Cached (Note this is uncached)

Expression : this.__mod3; return this.materialName;

materialName

materialName: String

The name the material will be stored under in the materials table. Thereafter using this in a color parameter will use this specification. It is also possible to override existing materials this way.

Flags : Cached, Required, Parameter (Note this is uncached)

Expression : ``

materialType

materialType: String

One of none, linebasic, linedashed, meshbasic, meshdepth, meshlambert, meshnormal, meshphong, meshphysical, meshstandard, meshtoon, points, rawshader, shader, shadow, sprite. These are three.js material types.

Flags : Cached, Parameter (Note this is uncached)

Expression : "Default"

metalness

metalness: Number

0.0 to 1.0. The relative 'metalness' of the material. Higher values are more metallic.

Flags : Cached, Parameter (Note this is uncached)

Expression : 0.5

normalMap

normalMap: String

The name of the texture to create a normal map. The type of normal map should be THREE.TangentSpaceNormalMap. 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.

Flags : Cached, Parameter (Note this is uncached)

Expression : ""

opacity

opacity: Number

0.0 to 1.0. 1.0 is completely opaque. Note that transparent must be true for this to have an effect for non-texture materials. For textured materials, which have their own definition for transparency (the alpha channel), this will be used and should normally be 1.0 in that case.

Flags : Cached, Parameter (Note this is uncached)

Expression : this.transparent ? 0.5 : 1.0

options

options: Any

Additional material options that can be supplied to THREE.Material of current materialType. Read the documentation foreach type of the material for more details. Note that the version of THREEJS in use may not match the documentation.

THREE.LineBasicMaterial THREE.LineDashedMaterial THREE.MeshBasicMaterial THREE.MeshDepthMaterial THREE.MeshDistanceMaterial THREE.MeshLambertMaterial THREE.MeshMatcapMaterial THREE.MeshNormalMaterial THREE.MeshPhongMaterial THREE.MeshPhysicalMaterial THREE.MeshStandardMaterial THREE.MeshToonMaterial THREE.PointsMaterial THREE.RawShaderMaterial THREE.ShaderMaterial THREE.ShadowMaterial THREE.SpriteMaterial

Flags : Cached, Parameter (Note this is uncached)

Expression : {}

receiveFog

receiveFog: Boolean

Whether the material is affected by fog. Default is true.

Flags : Cached, Parameter (Note this is uncached)

Expression : true

reflectivity

reflectivity: Number

0.0 to 1.0. Controls the level of reflectivity. 1.0 reflects almost all light.

Flags : Cached, Parameter (Note this is uncached)

Expression : 0.5

roughness

roughness: Number

0.0 to 1.0. The relative roughness of the material. This affects how it behaves under lighting. Higher values appear rougher.

Flags : Cached, Parameter (Note this is uncached)

Expression : 0.5

shininess

shininess: Number

How shiny the specular highlight is. A higher value gives a sharper highlight. Default is 30.

Flags : Cached, Parameter (Note this is uncached)

Expression : 30

side

side: String

One of 3 values: 'front', 'back', or 'double'. Or anything containing any capitalization of those three.

Flags : Cached, Parameter (Note this is uncached)

Expression : "Front"

spec

spec: Any

Internal Use Only.

Flags : Cached (Note this is uncached)

Expression : {color: this.color, shininess: this.shininess, roughness: this.roughness, metalness: this.metalness, transparent: this.transparent, opacity: this.opacity, side: this.side, reflectivity: this.reflectivity, normalMap : this.normalMap, alphaMap: this.alphaMap, map: this.texture, mapUrl: this.textureUrl, fog: this.receiveFog, ...this.options}

texture

texture: String

The name of the texture to use as a color map. Must be in the texture table from an already-defined Texture, or textureUrl should be non-empty. See the Texture Design for advanced texture definition.

Flags : Cached, Parameter (Note this is uncached)

Expression : ""

textureUrl

textureUrl: String

If non-empty, this is used to load the texture for this material.

Flags : Cached, Parameter (Note this is uncached)

Expression : ""

transparent

transparent: Boolean

Set to true to make a material transparent. Then set opacity to set how transparent it is.

Flags : Cached, Parameter (Note this is uncached)

Expression : false