ProtoTwin API
    Preparing search index...

    Class CustomMaterial

    Custom material.

    Custom materials are created through the editor, through scripting or by importing. They can be modified after creation and are stored inside the model.

    Hierarchy (View Summary)

    Index

    Accessors

    • get base(): Color

      The base color.

      Returns Color

      This is sometimes called the diffuse or albedo color.

    • set base(base: Color): void

      The base color.

      Parameters

      Returns void

      This is sometimes called the diffuse or albedo color.

    • get baseMap(): null | Texture

      The base map.

      Returns null | Texture

    • set baseMap(baseMap: null | Texture): void

      The base map.

      Parameters

      Returns void

    • get bumpiness(): number

      The bumpiness, in the interval [-1, 1].

      Returns number

      The bumpiness scales the strength of the normal map. This is sometimes called the "normal scale". A negative value inverts the normal map. This property has no effect if a normal map is not used.

    • set bumpiness(bumpiness: number): void

      The bumpiness, in the interval [-1, 1].

      Parameters

      • bumpiness: number

      Returns void

      The bumpiness scales the strength of the normal map. This is sometimes called the "normal scale". A negative value inverts the normal map. This property has no effect if a normal map is not used.

    • get displacement(): number

      The surface displacement, in the interval [0, 1].

      Returns number

      The displacement scales the strength of the displacement map. This property has no effect if a displacement map is not used. The displacement is applied using the Parallax Occlusion Mapping technique.

    • set displacement(displacement: number): void

      The surface displacement, in the interval [0, 1].

      Parameters

      • displacement: number

      Returns void

      The displacement scales the strength of the displacement map. This property has no effect if a displacement map is not used. The displacement is applied using the Parallax Occlusion Mapping technique.

    • get displacementMap(): null | Texture

      The displacement map.

      Returns null | Texture

    • set displacementMap(displacementMap: null | Texture): void

      The displacement map.

      Parameters

      Returns void

    • get emissive(): Color

      The emissive color.

      Returns Color

    • set emissive(emissive: Color): void

      The emissive color.

      Parameters

      Returns void

    • get emissiveMap(): null | Texture

      The emissive map.

      Returns null | Texture

    • set emissiveMap(emissiveMap: null | Texture): void

      The emissive map.

      Parameters

      Returns void

    • get emissiveStrength(): number

      The emissive strength, in the interval [0, inf].

      Returns number

    • set emissiveStrength(strength: number): void

      The emissive strength, in the interval [0, inf].

      Parameters

      • strength: number

      Returns void

    • get fullname(): string

      The fully qualified name that uniquely identifies the material.

      Returns string

      The fully qualified name is formed from the unique library path and the material name. The fully qualified name uniquely identifies the material within the materials database.

    • get metallicness(): number

      The metallicness, in the interval [0, 1].

      Returns number

      If a metallicness map is used then the metallicness scales the strength of the metallicness map. Otherwise, the metallicness specifies how metallic the material is. A value of zero specifies that the material is completely non-metallic. A value of one specifies that the material is completely metallic.

    • set metallicness(metallicness: number): void

      The metallicness, in the interval [0, 1].

      Parameters

      • metallicness: number

      Returns void

      If a metallicness map is used then the metallicness scales the strength of the metallicness map. Otherwise, the metallicness specifies how metallic the material is. A value of zero specifies that the material is completely non-metallic. A value of one specifies that the material is completely metallic.

    • get metallicnessMap(): null | Texture

      The metallicness map.

      Returns null | Texture

    • set metallicnessMap(metallicnessMap: null | Texture): void

      The metallicness map.

      Parameters

      Returns void

    • get normalMap(): null | Texture

      The normal map.

      Returns null | Texture

    • set normalMap(normalMap: null | Texture): void

      The normal map.

      Parameters

      Returns void

    • get occlusion(): number

      The surface occlusion, in the interval [0, 1].

      Returns number

      The occlusion scales the strength of the occlusion map. This property has no effect if a occlusion map is not used.

    • set occlusion(occlusion: number): void

      The surface occlusion, in the interval [0, 1].

      Parameters

      • occlusion: number

      Returns void

      The occlusion scales the strength of the occlusion map. This property has no effect if a occlusion map is not used.

    • get occlusionMap(): null | Texture

      The occlusion map.

      Returns null | Texture

    • set occlusionMap(occlusionMap: null | Texture): void

      The occlusion map.

      Parameters

      Returns void

    • get opacity(): number

      The opacity, in the interval [0, 1].

      Returns number

      A value of zero specifies that the material is fully transparent. A value of one specifies the the material is fully opaque.

    • set opacity(opacity: number): void

      The opacity, in the interval [0, 1].

      Parameters

      • opacity: number

      Returns void

      A value of zero specifies that the material is fully transparent. A value of one specifies the the material is fully opaque.

    • get roughness(): number

      The surface roughness, in the interval [0, 1].

      Returns number

      If a roughness map is used then the roughness scales the strength of the roughness map. Otherwise, the roughness specifies the uniform surface roughness of the material. A value of zero specifies that the material is perfectly smooth. A value of one specifies that the material is perfectly rough.

    • set roughness(roughness: number): void

      The surface roughness, in the interval [0, 1].

      Parameters

      • roughness: number

      Returns void

      If a roughness map is used then the roughness scales the strength of the roughness map. Otherwise, the roughness specifies the uniform surface roughness of the material. A value of zero specifies that the material is perfectly smooth. A value of one specifies that the material is perfectly rough.

    • get roughnessMap(): null | Texture

      The roughness map.

      Returns null | Texture

    • set roughnessMap(roughnessMap: null | Texture): void

      The roughness map.

      Parameters

      Returns void

    • get shader(): Shader

      The shader program that renders the material.

      Returns Shader

    • set shader(shader: Shader): void

      The shader program that renders the material.

      Parameters

      Returns void

    • get textureOffset(): Vec2

      The texture coordinate offset.

      Returns Vec2

      This offsets the UV coordinates for the mesh when textures are applied.

    • set textureOffset(textureOffset: Vec2): void

      The texture coordinate offset.

      Parameters

      Returns void

      This offsets the UV coordinates for the mesh when textures are applied.

    • get textureScale(): Vec2

      The texture coordinate scale.

      Returns Vec2

      This scales the UV coordinates for the mesh when textures are applied. A value of (2, 2) specifies that the texture is repeated twice.

    • set textureScale(textureScale: Vec2): void

      The texture coordinate scale.

      Parameters

      Returns void

      This scales the UV coordinates for the mesh when textures are applied. A value of (2, 2) specifies that the texture is repeated twice.

    • get transmission(): number

      The transmission, in the interval [0, 1].

      Returns number

      A value of zero specifies that the material is fully optically opaque. A value of one specifies the the material is fully optically transparent.

    • set transmission(transmission: number): void

      The transmission, in the interval [0, 1].

      Parameters

      • transmission: number

      Returns void

      A value of zero specifies that the material is fully optically opaque. A value of one specifies the the material is fully optically transparent.