Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Interface MeshMetadata

    Mesh node metadata from zarr .zattrs.

    Field-for-field what io/_compiler/geometry_writers/mesh.py stamps, plus the render attrs every geometry node shares.

    interface MeshMetadata {
        type: "mesh";
        n_vertices: number;
        n_faces: number;
        ndim: number;
        has_normals: boolean;
        normal_dims?: number[];
        has_colors: boolean;
        has_scalars: boolean;
        has_uvs: boolean;
        has_texture: boolean;
        texture_encoding?: MeshTextureEncoding;
        texture_width?: number;
        texture_height?: number;
        texture_channels?: number;
        texture_color_space?: MeshTextureColorSpace;
        texture_data_range?: [number, number];
        texture_filter?: MeshTextureFilter;
        texture_wrap?: MeshTextureWrap;
        shading: MeshShading;
        double_sided: boolean;
        ordering: "none";
        colormap?: string;
        scalar_data_range?: [number, number];
        color_data_range?: [number, number];
        has_labels?: boolean;
        has_image_labels?: boolean;
        has_keys?: boolean;
        transform?: number[];
        opacity?: number;
        absorption?: number;
        gamma?: number;
        intensity?: number;
        offset?: number;
        ambient?: number;
        shade_exponent?: number;
        specular?: number;
        shininess?: number;
        alpha_cutoff?: number;
        material?: MeshMaterialKind;
        roughness?: number;
        metalness?: number;
        clearcoat?: number;
        clearcoat_roughness?: number;
        iridescence?: number;
        sheen?: number;
        sheen_color?: string;
        transmission?: number;
        ior?: number;
        thickness?: number;
        attenuation_color?: string;
        attenuation_distance?: number;
        dispersion?: number;
        refract_data?: boolean;
        slab_tolerance?: number;
        blending_mode?: BlendingModeName;
        layer?: boolean;
        extend_to_all?: string[];
    }
    Index
    type: "mesh"

    Node type identifier

    n_vertices: number

    Total vertex count. Capped at MAX_MESH_VERTICES (spec §3.5, §6.5).

    n_faces: number

    Total triangle count

    ndim: number

    Vertex position dimensionality

    has_normals: boolean

    Whether a per-vertex normals array is present

    normal_dims?: number[]

    Which three dimension indices the 3-component stored normals describe. Present iff has_normals.

    This is never implicit. For a (t, x, y, z) mesh the "first three dimensions" are (t, x, y) — meaningless as a normal frame — which is the bug this attr exists to prevent. It is also the authored winding frame: sorted(normal_dims) is the axis triple whose column order the stored face winding is front-facing in (spec §3.2, §5.4).

    has_colors: boolean

    Whether a per-vertex colors array is present

    has_scalars: boolean

    Whether per-vertex scalar values for colormap lookup are present

    has_uvs: boolean

    Whether a per-vertex uvs array is present.

    Paired with has_texture: the writer refuses either alone, because each is inert without the other (UVs index into nothing; a texture with no mapping samples one arbitrary texel across every triangle).

    has_texture: boolean

    Whether a texture array is present

    texture_encoding?: MeshTextureEncoding

    How texture is stored. Present iff has_texture.

    texture_width?: number

    Declared texture width in pixels. Present iff has_texture.

    These three dimension attrs are load-bearing, not descriptive. For an encoded texture they are the only thing that bounds the decode before any bytes are fetched — a 200 KB JPEG can declare 30000x30000 and expand to 3.6 GB — so the preflight charges the decoded surface from these numbers and Stage 2 re-checks the decoded bitmap against them. See data/mesh/preflight.ts.

    texture_height?: number

    Declared texture height in pixels. Present iff has_texture.

    texture_channels?: number

    Channels per texel: 1, 3 or 4. Present iff has_texture.

    texture_color_space?: MeshTextureColorSpace

    Colour space of the texture's values. Present iff has_texture.

    texture_data_range?: [number, number]

    [min, max] of an HDR texture's RGB values, stamped only when the raw payload carried a value above 1.0.

    The texture peer of color_data_range, computed over RGB only (alpha excluded) so the viewer's window derivation reads one shape whatever the source.

    texture_filter?: MeshTextureFilter

    Sampling filter; viewer-defaulted to 'linear' when absent.

    texture_wrap?: MeshTextureWrap

    Wrap mode; viewer-defaulted when absent to repeat-in-u / clamp-in-v, which is what an equirectangular basemap needs — tiling across the dateline seam without bleeding the north pole into the south.

    shading: MeshShading

    How to obtain surface normals; always stamped by the writer

    double_sided: boolean

    Whether both faces of the surface are drawn (THREE.DoubleSide) rather than only the front (THREE.FrontSide).

    Note the viewer may render double-sided even when this is false: when projected winding cannot be decided against the authored frame, no index post-pass can restore it, so the epoch falls back to DoubleSide with a one-time notice (spec §5.4, §7).

    ordering: "none"

    Spatial ordering method. Always 'none' in v1 — the loader is whole-node, so there is no chunk index to skip. Stamped unconditionally so a reader never has to distinguish "no ordering" from "attr missing".

    colormap?: string

    Named colormap or 'custom' (paired with a colormap_lut zarr array)

    scalar_data_range?: [number, number]

    [min, max] for normalising scalars before LUT lookup

    color_data_range?: [number, number]

    Min/max of the color data, computed at encoding time

    has_labels?: boolean

    Whether per-vertex string labels exist (CSR-encoded, for hover tooltips)

    has_image_labels?: boolean

    Whether per-vertex image labels exist (CSR-encoded, for hover thumbnails)

    has_keys?: boolean

    Whether per-vertex stable string keys exist (CSR-encoded, for element actions)

    transform?: number[]

    4x4 transform matrix (column-major for THREE.js)

    opacity?: number

    Opacity multiplier

    absorption?: number

    Absorption coefficient (volumetric blending; mesh refuses that mode, §6.3)

    gamma?: number

    Gamma correction

    intensity?: number

    Intensity (linear color multiplier / gain)

    offset?: number

    Offset (additive brightness shift / black level subtraction)

    ambient?: number

    Offset-key shade floor in [0, 1] — what a face-away fragment keeps (§6.2). 1.0 removes the diffuse gradient; set specular = 0.0 as well for a fully emissive look.

    Optional and viewer-defaulted: the writer never stamps it, so it is present only when an author passed it through add_mesh(**attrs). Authoring support and the material read landed together so accepted values affect the rendered mesh.

    shade_exponent?: number

    Wrapped-diffuse exponent (§6.2). Clamped positive — pow(0, 0) is undefined GLSL.

    specular?: number

    Additive specular strength in [0, 1] (§6.2).

    shininess?: number

    Specular highlight exponent (> 0) (§6.2).

    alpha_cutoff?: number

    opaque-mode alpha cutout threshold in [0, 1] (§6.2).

    material?: MeshMaterialKind

    Which material family renders this mesh (docs/guides/specs/MESH_PHYSICAL_MATERIALS_SPEC.md §3.1).

    Absent or 'luxar': the house shader (§6.2). 'physical': three's own physically based material, lit by the scene environment the viewer builds lazily on the first such mesh. Written only when authored, so every pre-existing store reads as the house shader.

    roughness?: number

    Physical: microfacet roughness in [0, 1]; three's default 1.

    metalness?: number

    Physical: metalness in [0, 1]; three's default 0.

    clearcoat?: number

    Physical: clearcoat layer strength in [0, 1]; three's default 0.

    clearcoat_roughness?: number

    Physical: clearcoat roughness in [0, 1]; three's default 0.

    iridescence?: number

    Physical: thin-film iridescence strength in [0, 1]; three's default 0.

    sheen?: number

    Physical: sheen strength in [0, 1]; three's default 0.

    sheen_color?: string

    Physical: sheen tint as #rrggbb. Viewer-defaulted to WHITE rather than three's black, because a black sheen is a no-op and sheen alone would then render nothing.

    transmission?: number

    Physical (glass, spec §3.4): share of light transmitted in [0, 1]; three's default 0. Above zero the mesh composites as translucent and refracts the background and other meshes — NOT points, lines or splats, which three's transmission pass never sees, unless refract_data opts it in.

    ior?: number

    Physical: index of refraction in [1, 2.333]; three's default 1.5.

    thickness?: number

    Physical: refraction volume thickness in scene units, >= 0; three's default 0.

    attenuation_color?: string

    Physical: #rrggbb tint reached after attenuation_distance through the volume (Beer–Lambert); three's default white = no tint.

    attenuation_distance?: number

    Physical: attenuation length in scene units, > 0; absent = Infinity (none).

    dispersion?: number

    Physical: chromatic dispersion strength, >= 0; three's default 0.

    refract_data?: boolean

    Physical (glass, spec §3.4 Phase 3): draw this glass AFTER the emissive data so it refracts the points, lines and splats behind it. Absent = false (Phase 2 glass-first). Authoring refuses it without transmission > 0. Data in front of the glass stays crisp: the refraction split partitions every data fragment by depth against the glass's front surface (materials/_shared/glass-partition.ts).

    slab_tolerance?: number

    Half-width, IN CELLS, of the nD membership slab a CONTINUOUS hidden dimension is culled against (§5.2.1): a vertex is inside when it is within slab_tolerance cells of the slice. Strictly positive; defaults to one cell.

    The only authored control mesh has over its nD approximation, and the only per-node input to computeTolerance('mesh', …). Mesh culls whole triangles against the slab — a triangle draws only when all three of its vertices are inside — so on a continuous hidden axis it shows "the surface near this slice" as a thick slab, never a planar cut (§5.3). This says how far from the slice — the slab spans twice that.

    Mesh is the only geometry type whose continuous arm is tunable, and the reason is that it has nothing to measure: the other three derive their tolerance from a per-element extent (radii / widths / the truncated sigma) that a mesh vertex does not have, so the slab thickness is invented rather than read off the data.

    No effect on a DISCRETE hidden dimension (time, channel — the dominant real case), which takes the half-cell membership rule instead.

    blending_mode?: BlendingModeName
    layer?: boolean

    Whether this node is exposed as a layer in the Layers panel

    extend_to_all?: string[]

    Dimension names to extend visibility across — a mesh with extend_to_all is visible regardless of slice position in those dimensions.