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

    Module data/loaders/environment/environment-loader

    Load a baked environment map from the store's root-level environment/ sidecar group (luxar env attach; spec MESH_PHYSICAL_MATERIALS_SPEC.md ยง3.3).

    The group carries neither type nor kind, so build-scene-graph.ts skips it as a metadata sidecar โ€” nothing reads it implicitly, which is why this loader exists. Its faces attr names the live array (faces-<digest>; a re-bake is a NEW path, so a caching store can never serve stale faces), and scene_content_hash is the guard: the environment group is EXCLUDED from the scene digest on the Python side, so this comparison against the root's content_hash is exact. A mismatch means the scene changed since the bake; the map is ignored with a console line and the viewer falls back to its configured source or the room.

    Absence is the normal case and costs NO request when a root index fetched from the network this load is available: luxar env attach re-consolidates after writing the group, so a FRESH index is authoritative and one that lists no environment node means there is none. A CACHED index is not: the L2 tier revalidates the root only by content_hash, which env attach deliberately leaves unchanged, so a warm cache can keep serving the pre-attach index. On a warm load of a format-3 store the scene loader still has this load's network copy of the index (the load-time root-document fetch; data/scene-loader/cache/root-listing.ts). Only without one (format 2, a presigned or zipped source) is the group probed โ€” one document of the store's known format โ€” and a genuine absence is remembered per dataset for the session, so a revisit does not pay it again. When the source is unreachable, a cached map is used if available. Other failures degrade to "no baked map" without failing the scene load.

    EnvironmentRootListing
    resetEnvironmentProbeCacheForTests
    loadBakedEnvironment