Optional ReadonlybinFree-form bin identifier this SceneMesh belongs to. Frozen at construction; the scene assigns no semantics to the value on its own.
The bin is a tag the caller stamps on the SceneMesh for downstream consumers to group by. A renderer — were it rendering this scene — is expected to honour the tag as follows:
bin value (a missing or
empty bin is treated as the implicit "default" group)."overlay" after, with the
depth buffer cleared between groups so the overlay group reads as
floating on top of the rest of the scene).Bin membership lives on SceneMesh rather than
!scene.SceneObject | SceneObject because renderable
batching happens at mesh granularity — a SceneMesh can be processed
by a renderer without ever being assigned to a SceneObject, so this
is the layer at which bin membership is meaningful. Tools that
consume the scene but do not render it — model builders, exporters,
format converters, structural inspectors — may use bin as a
free-form classification, or ignore it. Loaders and exporters
round-trip the value verbatim.
Readonlygeometry!scene.SceneGeometry | SceneGeometry used by this SceneMesh.
ReadonlyidUnique ID of this SceneMesh.
SceneMesh is stored by this ID in SceneModel.meshes.
Optional Readonlymaterial!scene.SceneMaterial | SceneMaterial used by this SceneMesh.
The material is the canonical home for PBR parameters — roughness, metallic, and the colour/normal/etc. textures all live there. A mesh without a material falls back to renderer defaults (moderately rough dielectric, no textures).
ReadonlymodelThe SceneModel that contains this SceneMesh.
The !scene.SceneObject | SceneObject that uses this SceneMesh.
ReadonlyuniqueThe global ID of this SceneMesh, unique among all SceneMeshes within the Scene, which is the concatenation of the SceneModel's ID and this SceneMesh's ID, separated by "__".
Gets the RGB color for this SceneMesh.
Each element of the color is in range [0..1].
Sets the RGB color for this SceneMesh.
[0..1].
-- Overriden by the color of the material if this SceneMesh has a material.Effective alphaCutoff threshold for MASK mode. Defaults to 0.5
when no material is attached (matches glTF default).
Effective alpha-handling mode: 0 = OPAQUE, 1 = MASK, 2 = BLEND.
Defaults to OPAQUE when no material is attached.
Gets the effective RGB color for this SceneMesh, which is the color of the SceneMaterial if it has one, or the SceneMesh's own color otherwise.
Effective albedo (colour) texture — the material's colorTexture
if a material is attached, otherwise undefined. Untextured meshes
sample the per-batch atlas's white sentinel.
Effective hatch ink colour for this mesh as a four-float
(r, g, b, opacity) array. All channels are in [0, 1].
Returns null when the mesh has no material attached.
Effective number of hatch line families for this mesh
(0..4). 0 means "no hatch — surface renders without
overlay".
Effective hatch line families for this mesh. Returns the
attached material's pattern array when bound; otherwise
null to signal "no per-mesh hatch — render the surface
normally".
Four families × four floats wide, zero-padded after the
family count. Each family occupies four consecutive slots:
[cos(angle), sin(angle), spacing, lineWidth]. Callers
should consult effectiveHatchPatternCount for the
in-use family count.
Effective hatch coordinate-space flag — 0 for screen
space, 1 for world space. Returns 0 when the mesh has
no material attached.
Effective dash / gap pattern entries (line-width units) for
this mesh. Returns the attached material's pattern array
when bound; otherwise null to signal "no per-mesh
pattern — inherit the View-level fallback".
Eight entries wide, zero-padded after the pattern length. Callers should consult effectiveLinePatternLen to find the in-use count.
Effective dash / gap pattern length for this mesh. 0
means "no per-mesh pattern — inherit the View-level
fallback"; any positive value overrides it.
Effective dash / gap pattern period (sum of in-use entries,
in line-width units) — the natural modulus base when walking
the pattern along a segment. 0 when no per-mesh pattern is
set.
Effective per-mesh line thickness in pixels for the
thick-line draw technique. Returns the attached material's
lineWidth when one is bound; otherwise 0 to signal
"fall back to the View's linesMaterial.lineWidth". The
thick-line vertex shader implements that fallback.
Effective metallic factor — the material's metallic value if a material is attached, otherwise the renderer default (0.0).
Effective metallic-roughness texture — the material's
metallicRoughnessTexture if a material is attached, otherwise
undefined. Channel layout follows glTF 2.0: G = roughness,
B = metallic. Untextured meshes sample the per-batch MR atlas's
white sentinel — a multiplicative passthrough.
Effective tangent-space normal map — the material's normalsTexture
if a material is attached, otherwise undefined. Encoded RGB with
(x, y, z) = sample.rgb * 2 - 1. Untextured meshes sample the
per-batch normal-map atlas's neutral sentinel (128, 128, 255, 255),
which decodes to (0, 0, 1) — no perturbation.
Gets the effective opacity factor for this SceneMesh, which is the opacity of the material if it has one,
or the local opacity otherwise. This is a factor in range [0..1].
Effective microfacet roughness — the material's roughness if a material is attached, otherwise the renderer default (0.6).
The renderer's Cook-Torrance BRDF reads this; meshes without a material render as a moderately-rough dielectric.
Effective triplanar repeat distance — the material's
triplanarScale if a material is attached, otherwise the
renderer default (1.0). Read by the triplanar shader variant
to convert world-space position into texture-sample
coordinates; ignored on UV-bearing batches.
Gets the !scene.SceneGeometry | SceneGeometry used by this SceneMesh.
Gets the ID of the !scene.SceneMaterial | SceneMaterial used by this SceneMesh.
Gets this SceneMesh's local modeling transform matrix.
Default value is [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1].
Updates this SceneMesh's local modeling transform matrix.
[1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1].Gets the opacity factor for this SceneMesh.
This is a factor in range [0..1].
Sets the opacity factor for this SceneMesh.
[0..1].Gets the parent SceneTransform of this SceneMesh, or null if this SceneMesh is not parented.
Gets the global transform matrix for this SceneMesh.
Destroys this SceneMesh.
Sets the parent transform for this mesh.
The ID of the new parent transform, or null to detach.
Optionalopts: { preserveWorld?: boolean }Options to preserve world transformation.
InternalUpdates the global transform matrix.
Gets this SceneMesh as SceneMeshParams.
A mesh in a SceneModel.
See @xeokit/sdk/model/scene for usage.