A set of Textures in a SceneModel.

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

Properties

_alphaCutoff: number

Cut-off threshold for MASK mode. Fragments with albedoAlpha < alphaCutoff are discarded.

_alphaMode: number

Alpha-handling mode encoded as a small integer: 0 = OPAQUE, 1 = MASK, 2 = BLEND. Matches the glTF 2.0 alphaMode semantics. The shader reads this to decide whether to discard low-alpha fragments (MASK) or pass alpha through to the blender (BLEND).

_color: Vec3
_hatchPattern: NormalisedHatchPattern

Per-material screen-space hatch pattern for triangle-surface meshes. count is 0 for the default "solid (no hatch)" sentinel; any positive count paints one to four line families over the surface. See hatchPattern.

_hatchPatternUserValue: HatchStyle | HatchParams

Original user-facing value of hatchPattern, kept so the getter can return what the caller passed in (preset name or HatchParams) rather than the normalised internal form.

_linePattern: NormalisedLinePattern

Per-material dash / gap pattern, in line-width units. len is 0 for the default "inherit the View-level pattern" sentinel; any positive len overrides per-material. See linePattern.

_linePatternUserValue: number[] | model.scene.LineStyle

Original user-facing value of linePattern, kept so the getter can return what the caller passed in ("dashed" vs. an equivalent [3, 2]) rather than the normalised internal form.

_lineWidth: number

Per-material pixel line thickness for the renderer's thick line draw technique. 0 means "use the View's linesMaterial.lineWidth fallback"; any positive value overrides that fallback per-material.

_metallic: number
_opacity: number
_roughness: number
_triplanarScale: number

World-space repeat distance for the renderer's triplanar texture-sampling fallback (engages when a mesh that carries this material has no UV coordinates). Stored in scene units per texture repeat. Materials whose meshes all carry UVs ignore this value.

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. Maintained by SceneModel.createMesh / SceneModel._destroyMesh. 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