Cut-off threshold for MASK mode. Fragments with
albedoAlpha < alphaCutoff are discarded.
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).
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.
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.
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.
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.
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.
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.
OptionalcolorThe color SceneTexture in this set.
True if this SceneMaterial has been destroyed.
OptionalemissiveThe emissive SceneTexture in this set.
ReadonlyidThe ID of this SceneMaterial within the SceneModel.
OptionalmetallicThe metallic-roughness SceneTexture in this set.
OptionalnormalsThe 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.
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).
OptionalocclusionThe occlusion SceneTexture in this set.
ReadonlyuniqueThe 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 "__".
Internal— read by downstream consumers.
Internal— read by downstream consumers.
Internal— read by downstream consumers.
Internal— read by downstream consumers. 0 for screen-space, 1 for world-space.
Internal— read by downstream consumers.
Internal— read by downstream consumers.
Internal— read by downstream consumers.
Cut-off threshold used when alphaMode === MASK. Fragments with
albedoAlpha < alphaCutoff are discarded by the renderer.
Alpha-handling mode: 0 = OPAQUE, 1 = MASK, 2 = BLEND.
Matches the glTF 2.0 alphaMode semantics.
Gets the RGB color for this SceneMaterial.
Each element of the color is in range [0..1].
Sets the RGB color for this SceneMaterial.
[0..1].Per-material hatch pattern. Returns the originally-set
preset name or HatchParams value the caller passed
in — not the normalised internal form. Default is
"solid" (no hatch).
Updates the per-material hatch pattern. Accepts the same
value shapes as the constructor's hatchPattern param —
a HatchStyle preset name or a HatchParams
object. Fires
SceneEvents.onSceneMaterialPatternChanged.
Updates the per-material dash / gap pattern. Accepts the
same value shapes as the constructor's linePattern param
— a LineStyle preset name or a custom number[].
The change fires
SceneEvents.onSceneMaterialPatternChanged, which
the renderer picks up to re-encode the material's slot in
its per-batch pattern table without re-uploading per-mesh
data.
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.
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.
Gets the opacity factor for this SceneMaterial.
This is a factor in range [0..1].
Sets the opacity factor for this SceneMaterial.
[0..1].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.
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.
Destroys this SceneMaterial.
Refuses to destroy while at least one SceneMesh in the SceneModel still references this material — destroy or reassign those meshes first. Mirrors SceneGeometry.destroy.
Gets this SceneMaterial as SceneMaterialParams.
A set of Textures in a SceneModel.
See @xeokit/sdk/model/scene for usage.