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

    Mesh material properties driving the constructor config.

    The compositing half matches its three siblings field for field. What differs is named rather than quietly omitted, because each omission is a §9 exclusion or a §2.2 structural difference rather than an oversight:

    • no absorption — that uniform exists only for volumetric, and a zero-thickness surface has no path length for it to attenuate over (§6.3). The hasElementAlpha flag goes with it: it gates nothing but the volumetric w(a) = −ln(1−a) optical-depth map, and mesh's per-vertex alpha is a plain coverage term in every mode it supports, so there is nothing to gate;
    • no radiusScale / truncationRadius — both normalize a per-element extent, and a triangle's extent is its own vertices;
    • only HALF a camera surface (see LuxarMeshMaterial): a mesh's size IS its geometry, so there is no screen-space extent to recompute per camera change and updateCameraParams ignores resolution/isOrtho — but it does consume nearCull, because the shared near fade applies to a surface too (#1431);
    • blendingMode defaults to 'opaque', not 'additive' — the only mode unconditionally correct without per-triangle depth sorting (§6.3);
    • flatNormal is new: mesh is the first shaded type, and the stored-normal vs derivative-normal choice is a compile-time shader variant the caller resolves once per node.
    interface MeshMaterialProperties {
        blendingMode: BlendingModeName;
        opacity: number;
        gamma: number;
        intensity: number;
        offset: number;
        shading?: MeshShadingMode;
        baseColorTexture?: Texture<unknown, TextureEventMap>;
        baseColorTextureLuminance?: boolean;
        ambient?: number;
        shadeExponent?: number;
        specular?: number;
        shininess?: number;
        alphaCutoff?: number;
    }
    Index
    blendingMode: BlendingModeName
    opacity: number
    gamma: number
    intensity: number
    offset: number
    shading?: MeshShadingMode

    How normals are obtained: stored, screen-space derivatives, or none (unlit).

    One enum rather than the earlier flatNormal boolean, because a second boolean for the unlit arm would admit a meaningless flatNormal && noShading combination.

    baseColorTexture?: Texture<unknown, TextureEventMap>

    Base-colour texture, sampled per fragment. Excludes the other two sources.

    baseColorTextureLuminance?: boolean

    Whether baseColorTexture is single-channel (red replicated to RGB).

    ambient?: number

    Wrapped-diffuse shade floor, clamped to [0, 1] (1.0 = flat diffuse). Optional because the writer never stamps it — it reaches here only when an author passed it through add_mesh(**attrs).

    shadeExponent?: number

    Wrapped-diffuse exponent, clamped positive.

    specular?: number

    Additive specular strength, clamped to [0, 1].

    shininess?: number

    Specular exponent, clamped positive.

    alphaCutoff?: number

    opaque-mode cutout threshold, clamped to [0, 1].