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].Gets the emissive color factor for this SceneMaterial, as RGB in
[0..1]. Multiplied against SceneMaterial.emissiveTexture.
Sets the emissive color factor 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.