Skip to content

Repository files navigation

ED3DM-WebGPU

Interactive WebGPU interface for the Elite Dangerous galaxy generated by PEGE.

The project has two responsibilities:

  1. PEGE generates System identity and exact Sol-relative positions on demand in a browser Worker.
  2. ED3DM owns camera interaction, selection, search controls, themes, grids, LOD policy, and rendering.

The first-party Map app no longer loads its galaxy from placeholder JSON overview or tile files.

Run the Map app

npm install
npm test
npm run dev

Vite bundles the pinned PEGE 1.6 runtime as a versioned static asset. On first load, the Map app asks PEGE for a deterministic, coverage-first 50,000-System galaxy overview across all eight mass codes using the presentation-balanced stellar LOD policy. PEGE emits its final Systems at exact positions, with authored and generated display names decoded from their identities. ED3DM stores that overview in IndexedDB and keeps all 50,000 Systems as the far-field floor at every LOD; authored names therefore remain part of the same population as every other System. The complete authored catalogue stays private to PEGE for exact search and any placement knowledge required by reconstruction.

PEGE positions remain in raw Sol-relative Elite space. Sol is (0,0,0) and no catalogue-era translation is applied to any System. The Stellar Forge origin is used only to draw boxel faces around those coordinates.

The LOD slider leaves the complete 50,000-System overview resident and scales the additional camera-local procedural detail. The final red All Resident setting applies no additional ED3DM thinning to records already resident; it does not attempt to place the galaxy's roughly 400 billion Systems in browser memory at once. Local residency is centered on the last selected System; with no selection it follows the camera's X/Z focus at the current height, so panning or changing height can enter a new residency zone. A centered 1,280-ly h-sized cube receives the full local share, followed by complete g-, f-, and e-width 3D shells on all six sides with decreasing shares. PEGE's canonical storage tiles remain h-sized underneath, while ED3DM clips their genuine Systems into those geometric shells and publishes each complete shell together. The exact camera-local cube remains an independent closest-range layer, and the previous foreground stays visible during every transition.

The persistent overview remains the pickable 50,000-System floor. At galaxy scale a second, non-pickable density glow is drawn at those same genuine coordinates to communicate the aggregate population represented by each point; it fades completely before exact-local range and never becomes a System record. Factual resident detail remains fully opaque and exclusively pickable. Galactic-region title planes are hidden from close local views. Independently salted, stable ID64-keyed size and opacity variation prevents genuine coordinate phases from accumulating into uniform bright rows without jittering or relocating a System. PEGE bounds its procedural cache, while ED3DM requests aligned spatial and primary-render attributes in chunks of at most 4 MiB.

Search accepts:

  • exact authored or generated System names;
  • authored-name prefix suggestions plus an immediate decoded generated-name candidate; and
  • decimal ID64 values.

Generated names are decoded, regenerated, and validated by PEGE rather than stored in a galaxy-wide search index. Procedural prefix expansion remains intentionally unavailable because that namespace is generated on demand. A complete valid generated name immediately yields its ID64 and containing-boxel center, which lets ED3DM move the camera and begin local residency while PEGE performs exact placement replay. Only the replayed exact System becomes selected or pickable.

Selecting a System moves the X/Z grid plane to its exact Y coordinate and creates up to five nearest-neighbor selection rails. While selection is locked, only rail endpoints can become the next selected System; clicking empty space or closing the details panel returns to unrestricted factual-star selection without rewinding the camera.

Themes and stellar profiles

  • Paper and charcoal are artistic ED3DM themes.
  • Realistic, the default, consumes the primary star’s PEGE displayColor and radiusMeters when a Stellar profile is available.

PEGE 1.6 bulk-packs engine-owned primary Stellar profiles alongside spatial records. ED3DM uses the primary display color, class, mass, temperature, and optional radius supplied by PEGE. A selected System is resolved through PEGE's structured profile contract so every available primary and secondary Stellar component can be shown. Missing optional values stay missing instead of being invented from names or ID64s.

Embed

import { ED3DM, PegeGalaxySource } from "ed3dm-webgpu";

const map = await ED3DM.create({
  container: "#edmap",
  source: new PegeGalaxySource({ runtimeUrl: "/assets/pege-runtime.bin" }),
  lod: 20,
  theme: "realistic",
});

await map.focus({ x: 0, y: 0, z: 0 });

The GalaxySource seam remains public so tests and other generation engines can supply the same small interface without exposing PEGE’s Worker protocol to the renderer.

Validate

npm test
npm run typecheck
npm run build
npm run build:lib

Research and supported-interface details are recorded in docs/research/pege-integration.md and the PEGE 1.5 spatial-streaming frontend handoff. Older migration notes are retained as historical records.

ED3DM-WebGPU is MIT licensed. PEGE is an Apache-2.0 dependency; retain its license and notices when redistributing the bundled runtime.

About

Elite Dangerous 3D map library (WebGPU + WebGL2 fallback). Operators host their own Catalog.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages