ProtoTwin API
    Preparing search index...

    Class MaterialAbstract

    Base class for materials.

    The material properties are in accordance with the GLTF 2.0 specification https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html.

    Hierarchy (View Summary)

    Index

    Accessors

    • get base(): Color

      The base color.

      Returns Color

      This is sometimes called the diffuse or albedo color.

    • 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.

    • get combinedMetallicnessRoughness(): boolean

      Whether the metallicness and roughness maps are combined into a single texture.

      Returns boolean

    • 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.

    • get displacementMap(): null | Texture

      The displacement map.

      Returns null | Texture

    • get emissive(): Color

      The emissive color.

      Returns Color

    • get emissiveMap(): null | Texture

      The emissive map.

      Returns null | Texture

    • get emissiveStrength(): number

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

      Returns number

    • 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.

    • get metallicnessMap(): null | Texture

      The metallicness map.

      Returns null | Texture

    • get name(): string

      The name that uniquely identifies the material within the library.

      Returns string

    • 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.

    • get occlusionMap(): null | Texture

      The occlusion map.

      Returns null | Texture

    • 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.

    • 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.

    • get roughnessMap(): null | Texture

      The roughness map.

      Returns null | Texture

    • get shader(): Shader

      The shader program that renders the material.

      Returns Shader

    • get textureOffset(): Vec2

      The texture coordinate offset.

      Returns Vec2

      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.

    • 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.