A set of Textures in a SceneModel.

See @xeokit/sdk/model/scene for usage.

Properties

colorTexture?: SceneTexture

The color SceneTexture in this set.

destroyed: boolean = false

True if this SceneMaterial has been destroyed.

emissiveTexture?: SceneTexture

The emissive SceneTexture in this set.

id: string

The ID of this SceneMaterial within the SceneModel.

metallicRoughnessTexture?: SceneTexture

The metallic-roughness SceneTexture in this set.

normalsTexture?: SceneTexture

The tangent-space normal map SceneTexture in this set.

RGB encodes a tangent-space perturbation as (x*0.5+0.5, y*0.5+0.5, z*0.5+0.5). The renderer transforms it into view space via a per-pixel TBN built from view-space derivatives.

numMeshes: number

The count of SceneMeshes that reference this SceneMaterial. SceneModel updates this count as meshes are created and destroyed. Used by destroy to refuse destruction while at least one mesh still references the material (the same guard SceneGeometry.destroy carries).

occlusionTexture?: SceneTexture

The occlusion SceneTexture in this set.

uniqueId: string

The global ID of this SceneMaterial, unique among all SceneMaterials within the Scene, which is the concatenation of the SceneModel's ID and this SceneMaterial's ID, separated by "__".

Accessors

  • get lineWidth(): number

    Per-material pixel line thickness, in screen pixels. 0 means "fall back to the View's linesMaterial.lineWidth"; any positive value overrides that fallback for meshes using this material. Only line-primitive meshes consume it.

    Returns number

  • get metallic(): number

    Metallic factor consumed by the Cook-Torrance BRDF.

    0 is a pure dielectric (Fresnel F0 is 0.04 grey); 1 is a pure metal (Fresnel F0 is the surface colour or sampled colour-texture value, diffuse term suppressed). Only consulted on the smooth-shaded render path.

    Returns number

  • get roughness(): number

    Microfacet roughness consumed by the Cook-Torrance BRDF.

    0 is mirror-smooth, 1 is fully diffuse. Only consulted on the smooth-shaded (per-vertex normals) render path.

    Returns number

  • get triplanarScale(): number

    World-space repeat distance for triplanar texture sampling, in scene units per texture repeat. Consulted by a renderer when a mesh carrying this material has no UV coordinates and the material binds a texture; ignored otherwise.

    Returns number

Methods